Thanks to visit codestin.com
Credit goes to github.com

Skip to content

revert: "perf: reduce Module size"#7

Merged
hyf0 merged 1 commit into
mainfrom
revert-6-perf-box-module
Sep 19, 2023
Merged

revert: "perf: reduce Module size"#7
hyf0 merged 1 commit into
mainfrom
revert-6-perf-box-module

Conversation

@hyf0
Copy link
Copy Markdown
Member

@hyf0 hyf0 commented Sep 19, 2023

Reverts #6

Module would be stored in Vec, which is already in the heap. Wrapping with Box will cause extra dereferencing on every visiting, which Module would be visited frequently a lot.

ExternalModule are few, you don't need to worry about the memory usages now.

@hyf0 hyf0 merged commit 711ddb0 into main Sep 19, 2023
@hyf0
Copy link
Copy Markdown
Member Author

hyf0 commented Sep 19, 2023

@underfin Reducing type size is a good way to improve performance, but it also has it's own restrictions.

Replacing Box<str> with thin_str is a win, but it's not only about reducing the size. Box<Box<str>>(1 * usize) is also smaller than Box<str>(2 * usize), but accessing Box<Box<str>> would be much slower than Box<str>.

@hyf0 hyf0 deleted the revert-6-perf-box-module branch September 19, 2023 13:21
@hyf0 hyf0 restored the revert-6-perf-box-module branch September 19, 2023 13:22
@hyf0 hyf0 deleted the revert-6-perf-box-module branch September 19, 2023 13:26
@hyf0 hyf0 restored the revert-6-perf-box-module branch September 19, 2023 13:26
@underfin underfin deleted the revert-6-perf-box-module branch September 25, 2023 12:12
hyf0-agent added a commit to hyf0-agent/rolldown that referenced this pull request Mar 26, 2026
Arena allocator investigation for optimization rolldown#7 found that:
- AST drops are only 1.7ms with mimalloc (negligible)
- madvise: 78-94 vs bun's 24 (already close)
- The remaining ~100ms gap is purely computational

The only actionable improvement: use std::process::exit(0) to skip
tokio runtime shutdown, rayon thread pool teardown, and data structure
drops. Saves ~20-30ms of wall time. Tool-reported time is unchanged
since it measures up to file write completion.
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