GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||
GeezerVison is showing github.com — src: do not shrink async resources on every pop by nigrosimone · Pull Request #66344 · nodejs/node Conversation
|
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@ ## main #66344 +/- ## ========================================== - Coverage 92.86% 90.50% -2.36% ========================================== Files 428 797 +369 Lines 195100 278361 +83261 Branches 30147 53500 +23353 ========================================== + Hits 181175 251936 +70761 - Misses 13597 16809 +3212 - Partials 328 9616 +9288
🚀 New features to boost your workflow:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@anonrig CI is green and this has your approval for more than 7 days, could you add commit-queue? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I like this change, however this means on Windows it will never shrink
I am still approving because async_ids_stack_, sitting right next to it, already keeps 16 bytes per level forever, on every platform, so we're already making similar tradeoffs
Sorry, something went wrong.
There was an error while loading. Please reload this page.
AsyncHooks::pop_async_context() calls shrink_to_fit() on native_execution_async_resources_ after every pop. With the MSVC and libc++ standard libraries, shrink_to_fit() on an empty std::deque frees its storage, so every top-level callback scope allocates it again on push and frees it on pop. libstdc++ does nothing here. A program with the same pattern, a std::deque of the same variant going from 0 to 1 to 0 elements, takes 136-147 ns per callback on Windows with MSVC, and 6 ns without shrink_to_fit(). The async_ids_stack_ next to it never shrinks either. Refs: nodejs/performance#24 Signed-off-by: Nigro Simone <[email protected]>
a3a1b3c to
a979326
Compare
|
Rebased on main after #66395 landed, it touched the same lines in @anonrig @gurgunday could one of you start a CI and add commit-queue? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Landed in 2231574 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
AsyncHooks::pop_async_context() calls shrink_to_fit() on native_execution_async_resources_ after every pop. With the MSVC and libc++ standard libraries, shrink_to_fit() on an empty std::deque frees its storage, so every top-level callback scope allocates it again on push and frees it on pop. libstdc++ does nothing here. A program with the same pattern, a std::deque of the same variant going from 0 to 1 to 0 elements, takes 136-147 ns per callback on Windows with MSVC, and 6 ns without shrink_to_fit(). The async_ids_stack_ next to it never shrinks either. Refs: nodejs/performance#24 Signed-off-by: Nigro Simone <[email protected]> PR-URL: #66344 Refs: #66316 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
AsyncHooks::pop_async_context() calls shrink_to_fit() on native_execution_async_resources_ after every pop. With the MSVC and libc++ standard libraries, shrink_to_fit() on an empty std::deque frees its storage, so every top-level callback scope allocates it again on push and frees it on pop. libstdc++ does nothing here. A program with the same pattern, a std::deque of the same variant going from 0 to 1 to 0 elements, takes 136-147 ns per callback on Windows with MSVC, and 6 ns without shrink_to_fit(). The async_ids_stack_ next to it never shrinks either. Refs: nodejs/performance#24 Signed-off-by: Nigro Simone <[email protected]> PR-URL: nodejs#66344 Refs: nodejs#66316 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Gürgün Dayıoğlu <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.