Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Apr 1, 2025

This drastically improves the performance of running the test suite even though most users probably won't see any effect.

Prior to this change the symbol generation process itself always happened with a global symbol list lock held. Now we use a per-symbol-list lock which means that only linker processes with identical linker flags with contend for the lock.

before:

  • hot: 0m25.259s
  • cold: 1m36.121s

after:

  • hot: 0m21.371s
  • cold: 0m20.350s

This also happens to fix #18622 since it avoids using cache.get() which does logging.

This drastically improves the performance of running the test suite
even though most users probably won't see any effect.

Prior to this change the symbol generation process itself always
happened with the symbol list lock held.  Now in the most common cases
the symbol list is generated before we grab the lock.

before:

- hot: 0m25.259s
- cold: 1m36.121s

after:

- hot: 0m21.371s
- cold: 0m20.350s
@sbc100 sbc100 merged commit b1ef10f into emscripten-core:main Apr 2, 2025
28 checks passed
@sbc100 sbc100 deleted the improve_symbol_cache2 branch April 2, 2025 16:45
sbc100 added a commit to sbc100/emscripten that referenced this pull request Apr 2, 2025
See tox-dev/filelock#31
And https://stackoverflow.com/a/51070775

Without this change the `cache/symbol_lists` directory ends up full of
many lock files that might never get cleaned up (At least since emscripten-core#24029
landed).
sbc100 added a commit to sbc100/emscripten that referenced this pull request Apr 2, 2025
See tox-dev/filelock#31
And https://stackoverflow.com/a/51070775

Without this change the `cache/symbol_lists` directory ends up full of
many lock files that might never get cleaned up (At least since emscripten-core#24029
landed).
sbc100 added a commit that referenced this pull request Apr 2, 2025
See tox-dev/filelock#31 and
https://stackoverflow.com/a/51070775.

Without this change the `cache/symbol_lists` directory ends up full of
many lock files that might never get cleaned up (At least since #24029
landed).

I'm also sending this change upstream:
tox-dev/filelock#408
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.

Constant "generating system asset: symbol_lists/<hash>" in build

2 participants