diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-22 16:27:04 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-22 16:27:04 +0100 |
commit | 7ca37d12deccec3ce1ef54ad9aaab66f22b95fc3 (patch) | |
tree | e6bebd6b7037c7afa3ae659efccf0a855adda6a4 | |
parent | 09c376afeea6c74642c57fa19b13f714d2189a01 (diff) |
add timing info in emscript
-rwxr-xr-x | emscripten.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/emscripten.py b/emscripten.py index ae3e671f..af2570ee 100755 --- a/emscripten.py +++ b/emscripten.py @@ -178,7 +178,7 @@ def emscript(infile, settings, outfile, libraries=[]): def load_from_cache(chunk): keys = [settings_text, forwarded_data, chunk] shortkey = shared.JCache.get_shortkey(keys) # TODO: share shortkeys with later code - out = shared.JCache.get(shortkey, keys) + out = shared.JCache.get(shortkey, keys) # this is relatively expensive (pickling?) if out: cached_outputs.append(out) return False @@ -219,6 +219,9 @@ def emscript(infile, settings, outfile, libraries=[]): outputs = [output.split('//FORWARDED_DATA:') for output in outputs] + if DEBUG: print >> sys.stderr, ' emscript: phase 2 took %s seconds' % (time.time() - t) + if DEBUG: t = time.time() + funcs_js = ''.join([output[0] for output in outputs]) for func_js, curr_forwarded_data in outputs: @@ -230,7 +233,7 @@ def emscript(infile, settings, outfile, libraries=[]): for key in curr_forwarded_json['Functions']['indexedFunctions'].iterkeys(): indexed_functions.add(key) outputs = None - if DEBUG: print >> sys.stderr, ' emscript: phase 2 took %s seconds' % (time.time() - t) + if DEBUG: print >> sys.stderr, ' emscript: phase 2b took %s seconds' % (time.time() - t) if DEBUG: t = time.time() # calculations on merged forwarded data @@ -261,7 +264,7 @@ def emscript(infile, settings, outfile, libraries=[]): forwarded_data = json.dumps(forwarded_json) forwarded_file = temp_files.get('.2.json').name open(forwarded_file, 'w').write(indexize(forwarded_data)) - if DEBUG: print >> sys.stderr, ' emscript: phase 2b took %s seconds' % (time.time() - t) + if DEBUG: print >> sys.stderr, ' emscript: phase 2c took %s seconds' % (time.time() - t) # Phase 3 - post if DEBUG: t = time.time() |