Skip to content

Address #809#810

Draft
mjp41 wants to merge 2 commits intomainfrom
post_teardown_perf
Draft

Address #809#810
mjp41 wants to merge 2 commits intomainfrom
post_teardown_perf

Conversation

@mjp41
Copy link
Member

@mjp41 mjp41 commented Feb 5, 2026

Experiment to improve the performance post teardown.

mjp41 added 2 commits February 5, 2026 16:58
- add perf test that compares baseline frees vs frees after ThreadAlloc teardown
- cover atexit/static destruction scenario to repro post-finalisation slowdown
The teardown code can be a performance bottleneck when a lot of deallocations occur after a thread begins to be torn down.

This code tracks how many operations have occured after the thread has been torndown, and will stop performing the tidying with an exponential back-off.

This takes the overhead on the microbenchmark from around 50x to 10x.
@mjp41 mjp41 force-pushed the post_teardown_perf branch from 75c1fc7 to bbd7edc Compare February 5, 2026 16:59
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 5, 2026
akrieger added a commit to akrieger/Cataclysm-DDA that referenced this pull request Feb 5, 2026
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.

1 participant