This repository has been archived by the owner on Oct 3, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Node.js v12 is affected by a V8 regression where many
insert/deletes on a POJO will trigger an undefined state on V8, leading
to a huge performance regression which can cause each insert/delete
operations on that object to take hundreds of times more. The Map
structure is not affected by this performance regression (and is
recommended by engine developers to deal with large key/value stores).
Contexts on cls-ah are stored on a POJO, and since inserts/deletes
happen often (they are triggered by async_hooks on init and destroy),
applications with high RPS or with high amount of async operations will
hit the threshold, turning the regression on and leading to a huge
performance overhead on each new async operation. Changing to a Map will
avoid that issue.
Ref: nodejs/node#31961