aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xemscripten.py6
-rwxr-xr-xtests/runner.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/emscripten.py b/emscripten.py
index b3e153c1..bf049ee5 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -43,7 +43,7 @@ def scan(ll, settings):
if len(blockaddrs) > 0:
settings['NECESSARY_BLOCKADDRS'] = blockaddrs
-NUM_CHUNKS_PER_CORE = 5
+NUM_CHUNKS_PER_CORE = 2
MIN_CHUNK_SIZE = 1024*1024
MAX_CHUNK_SIZE = float(os.environ.get('EMSCRIPT_MAX_CHUNK_SIZE') or 'inf') # configuring this is just for debugging purposes
@@ -163,9 +163,9 @@ def emscript(infile, settings, outfile, libraries=[]):
cores = multiprocessing.cpu_count()
assert cores >= 1
if cores > 1:
- intended_num_chunks = cores * NUM_CHUNKS_PER_CORE
+ intended_num_chunks = int(cores * NUM_CHUNKS_PER_CORE)
chunk_size = max(MIN_CHUNK_SIZE, total_ll_size / intended_num_chunks)
- chunk_size += 3*len(meta) # keep ratio of lots of function code to meta (expensive to process, and done in each parallel task)
+ chunk_size += 3*len(meta) + len(forwarded_data)/3 # keep ratio of lots of function code to meta (expensive to process, and done in each parallel task) and forwarded data (less expensive but potentially significant)
chunk_size = min(MAX_CHUNK_SIZE, chunk_size)
else:
chunk_size = MAX_CHUNK_SIZE # if 1 core, just use the max chunk size
diff --git a/tests/runner.py b/tests/runner.py
index 96a2dabd..f4bb327e 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -9446,8 +9446,8 @@ f.close()
try:
os.environ['EMCC_DEBUG'] = '1'
for asm, linkable, chunks, js_chunks in [
- (0, 0, 3, 2), (0, 1, 7, 4),
- (1, 0, 3, 2), (1, 1, 7, 5)
+ (0, 0, 2, 2), (0, 1, 5, 4),
+ (1, 0, 2, 2), (1, 1, 5, 5)
]:
print asm, linkable, chunks, js_chunks
output, err = Popen([PYTHON, EMCC, path_from_root('tests', 'hello_libcxx.cpp'), '-O1', '-s', 'LINKABLE=%d' % linkable, '-s', 'ASM_JS=%d' % asm], stdout=PIPE, stderr=PIPE).communicate()