Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions crates/oxc_allocator/src/bump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,8 @@ const MALLOC_OVERHEAD: usize = 16;
// nearest suitable size boundary.
const OVERHEAD: usize = (MALLOC_OVERHEAD + FOOTER_SIZE + (CHUNK_ALIGN - 1)) & !(CHUNK_ALIGN - 1);

// Choose a relatively small default initial chunk size, since we double chunk
// sizes as we grow bump arenas to amortize costs of hitting the global
// allocator.
const FIRST_ALLOCATION_GOAL: usize = 1 << 9;
// 16KB covers the majority of real-world JS/TS files and reduces malloc calls by ~30%.
const FIRST_ALLOCATION_GOAL: usize = 1 << 14;

// The actual size of the first allocation is going to be a bit smaller
// than the goal. We need to make room for the footer, and we also need
Expand Down Expand Up @@ -575,7 +573,7 @@ impl Bump {

let chunk_footer = unsafe {
Self::new_chunk(
Bump::new_chunk_memory_details(None, layout).ok_or(AllocErr)?,
Bump::new_chunk_memory_details(Some(capacity), layout).ok_or(AllocErr)?,
layout,
EMPTY_CHUNK.get(),
)
Expand Down
6 changes: 3 additions & 3 deletions tasks/track_memory_allocations/allocs_minifier.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ checker.ts | 2.92 MB || 4128 | 1669 |

cal.com.tsx | 1.06 MB || 21098 | 474 || 37138 | 4586

RadixUIAdoptionSection.jsx | 2.52 kB || 65 | 3 || 30 | 6
RadixUIAdoptionSection.jsx | 2.52 kB || 58 | 3 || 30 | 6

pdf.mjs | 567.30 kB || 4691 | 569 || 47464 | 7730

antd.js | 6.69 MB || 10732 | 2514 || 331644 | 69358
antd.js | 6.69 MB || 10728 | 2514 || 331644 | 69358

binder.ts | 193.08 kB || 431 | 119 || 7075 | 824
binder.ts | 193.08 kB || 430 | 119 || 7075 | 824

2 changes: 1 addition & 1 deletion tasks/track_memory_allocations/allocs_semantic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ checker.ts | 2.92 MB || 2166 | 1015 |

cal.com.tsx | 1.06 MB || 14986 | 208 || 0 | 0

RadixUIAdoptionSection.jsx | 2.52 kB || 23 | 0 || 0 | 0
RadixUIAdoptionSection.jsx | 2.52 kB || 21 | 0 || 0 | 0

pdf.mjs | 567.30 kB || 1756 | 284 || 0 | 0

Expand Down
Loading