[turbopack] Use an arena for JSValues#94297
Open
sampoder wants to merge 1 commit into
Open
Conversation
Contributor
Stats skippedCommit: 9c87cd9 |
Contributor
Failing test suitesCommit: 9c87cd9 | About building and testing Next.js
Expand output● app dir - metadata static routes cache › should generate different content after replace the static metadata file Other failing CI jobs |
Bump-allocates the analyzer's `JsValue` tree into a per-thread arena (`ThreadLocal<Bump>`) that lives for the duration of `analyze_ecmascript_module_internal` and is freed in one shot when it returns, replacing the previous `Arc`/`Box`/`Vec` heap allocations. `JsValue` becomes `JsValue<'a>`, with its list children stored in `BumpVec` (growable) or `bumpalo::boxed::Box<[_]>` (fixed) and scalar children in `bumpalo::boxed::Box`. Sync functions take `&Bump` and allocate directly; the async (`Send`-bound) analysis pipeline holds a `&ThreadLocal<Bump>` and obtains a `&Bump` via `get_or_default()`, so no `!Send` `&Bump` is ever held across an `.await`. Builds on the `BumpVec` introduced in the previous commit.
a98d014 to
e21492c
Compare
4b5a6ea to
9c87cd9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR takes the arena introduced in #94296 and uses it! It's large but shouldn't change functionality beyond the use of the arena. Some syntax related to pattern-matching had to change because
bumpalo'sBoxdoesn't support the same pattern matching that the standard library'sBoxdoes but the code should be equivalent.