Skip to content

Commit

Permalink
tools: Update codecbench to make it easier to run
Browse files Browse the repository at this point in the history
make codecbench.wasm now builds a standalone .wasm executable. This
change also disables memory growth to make sure that we have the minimum
number of imports.
  • Loading branch information
zeux committed Feb 13, 2020
1 parent e98e6cc commit 04d3c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ vcachetuner: tools/vcachetuner.cpp $(BUILD)/tools/meshloader.cpp.o $(BUILD)/demo
codecbench: tools/codecbench.cpp $(LIBRARY)
$(CXX) $^ $(CXXFLAGS) $(LDFLAGS) -o $@

codecbench.js: tools/codecbench.cpp ${LIBRARY_SOURCES}
emcc $^ -O3 -DNDEBUG -s ALLOW_MEMORY_GROWTH=1 -o $@
codecbench.js codecbench.wasm: tools/codecbench.cpp ${LIBRARY_SOURCES}
emcc $^ -O3 -DNDEBUG -s TOTAL_MEMORY=268435456 -o $@

codecbench-simd.js: tools/codecbench.cpp ${LIBRARY_SOURCES}
emcc $^ -O3 -DNDEBUG -s ALLOW_MEMORY_GROWTH=1 -munimplemented-simd128 -o $@
codecbench-simd.js codecbensh-simd.wasm: tools/codecbench.cpp ${LIBRARY_SOURCES}
emcc $^ -O3 -DNDEBUG -s TOTAL_MEMORY=268435456 -munimplemented-simd128 -o $@

$(LIBRARY): $(LIBRARY_OBJECTS)
ar rcs $@ $^
Expand Down
2 changes: 1 addition & 1 deletion tools/codecbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main()
{
meshopt_encodeIndexVersion(1);

const int N = 2000;
const int N = 1000;

std::vector<Vertex> vertices;
vertices.reserve((N + 1) * (N + 1));
Expand Down

0 comments on commit 04d3c3e

Please sign in to comment.