Skip to content

Commit 7301dcd

Browse files
authored
Make use of profiling function decorator. NFC (#19580)
This avoids extra nesting just for profiling.
1 parent 8f2dfeb commit 7301dcd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

emcc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ def get_subresource_location(path, data_uri=None):
10971097
return os.path.basename(path)
10981098

10991099

1100-
@ToolchainProfiler.profile_block('package_files')
1100+
@ToolchainProfiler.profile()
11011101
def package_files(options, target):
11021102
rtn = []
11031103
logger.debug('setting up files')
@@ -3113,7 +3113,7 @@ def phase_link(linker_arguments, wasm_target, js_syms):
31133113
building.link_lld(linker_arguments, wasm_target, external_symbols=js_syms)
31143114

31153115

3116-
@ToolchainProfiler.profile_block('post_link')
3116+
@ToolchainProfiler.profile_block('post link')
31173117
def phase_post_link(options, state, in_wasm, wasm_target, target, js_syms):
31183118
global final_js
31193119

@@ -3814,9 +3814,8 @@ def preprocess_wasm2js_script():
38143814
if options.emit_symbol_map:
38153815
intermediate_debug_info -= 1
38163816
if os.path.exists(wasm_target):
3817-
with ToolchainProfiler.profile_block('handle_final_symbols'):
3818-
building.handle_final_wasm_symbols(wasm_file=wasm_target, symbols_file=symbols_file, debug_info=intermediate_debug_info)
3819-
save_intermediate_with_wasm('symbolmap', wasm_target)
3817+
building.handle_final_wasm_symbols(wasm_file=wasm_target, symbols_file=symbols_file, debug_info=intermediate_debug_info)
3818+
save_intermediate_with_wasm('symbolmap', wasm_target)
38203819

38213820
if settings.DEBUG_LEVEL >= 3 and settings.SEPARATE_DWARF and os.path.exists(wasm_target):
38223821
building.emit_debug_on_side(wasm_target)

tools/building.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,7 @@ def instrument_js_for_safe_heap(js_file):
10161016
return acorn_optimizer(js_file, ['safeHeap'])
10171017

10181018

1019+
@ToolchainProfiler.profile()
10191020
def handle_final_wasm_symbols(wasm_file, symbols_file, debug_info):
10201021
logger.debug('handle_final_wasm_symbols')
10211022
args = []

0 commit comments

Comments
 (0)