Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Dec 11, 2025

  1. This replaces uses of Pattern.split with Pattern.finditer.
  2. In extract_func_ranges, instead of splitting the whole text into single tags first and searches DW_TAG_(subprogram|inlined_subroutine) in each of them, we search the pattern from the whole text using finditer and tries to parse a tag from each match.

This improves running time on wasm-opt.wasm by ~18% (14.9s -> 12.2s).

1. This replaces uses of `Pattern.split` with `Pattern.finditer`.
2. In `extract_func_ranges`, instead of splitting the whole text into
   single tags first and searches
   `DW_TAG_(subprogram|inlined_subroutine)` in each of them, we search
   the pattern from the whole text using `finditer` and tries to parse a
   tag from each match.

This improves running time on `wasm-opt.wasm` by ~18% (14.9s -> 12.2s).
try:
current_match = next(iterator)
except StopIteration:
return map_stmt_list_to_comp_dir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you skip the try/catch and just do current_match = next(iterator, None)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants