diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b71063b6..3fdbe9c44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,10 +123,11 @@ if(EMSCRIPTEN) add_compile_options(-pthread) # mimalloc is needed for good performance add_link_options(-sMALLOC=mimalloc) + add_link_options(-sPTHREAD_POOL_SIZE=4) # The default stack size apparently causes problem when parallelization is # enabled. - add_link_options(-sSTACK_SIZE=20MB) - add_link_options(-sINITIAL_MEMORY=20MB) + add_link_options(-sSTACK_SIZE=30MB) + add_link_options(-sINITIAL_MEMORY=32MB) endif() if(MANIFOLD_DEBUG) list(APPEND MANIFOLD_FLAGS -fexceptions) diff --git a/flake.nix b/flake.nix index e24baafb8..ee78a62ee 100644 --- a/flake.nix +++ b/flake.nix @@ -125,7 +125,7 @@ export EM_CACHE=$(pwd)/.emscriptencache mkdir build cd build - emcmake cmake -DCMAKE_BUILD_TYPE=Release \ + emcmake cmake -DCMAKE_BUILD_TYPE=MinSizeRel \ -DMANIFOLD_PAR=${if parallel then "ON" else "OFF"} \ -DFETCHCONTENT_SOURCE_DIR_GOOGLETEST=${gtest-src} \ -DFETCHCONTENT_SOURCE_DIR_TBB=${onetbb-src} \ diff --git a/test/test_main.cpp b/test/test_main.cpp index 7408629b8..aca1ab65e 100644 --- a/test/test_main.cpp +++ b/test/test_main.cpp @@ -18,7 +18,6 @@ #include "test.h" #if (MANIFOLD_PAR == 1) -#include #include #endif @@ -54,8 +53,6 @@ int main(int argc, char** argv) { // https://github.com/oneapi-src/oneTBB/blob/master/WASM_Support.md#limitations #if defined(__EMSCRIPTEN__) && (MANIFOLD_PAR == 1) int num_threads = tbb::this_task_arena::max_concurrency(); - oneapi::tbb::global_control global_limit( - tbb::global_control::thread_stack_size, 16 * 1024 * 1024); std::atomic barrier{num_threads}; tbb::parallel_for( 0, num_threads,