Closed Bug 91805 Opened 24 years ago Closed 7 years ago

Bad frame arena size causes allocations of blocks of ~4108 bytes.

Categories

(Core :: Layout, defect, P3)

x86
Windows 2000
defect

Tracking

()

RESOLVED INCOMPLETE
Future

People

(Reporter: bratell, Assigned: dbaron)

Details

(Keywords: perf)

The frame arenas are specified of being of size 4096, but there are some overhead in the PL_Arena so the allocations are of ~4108 bytes. That is sub optimal with many memory allocators. I lowered it to 4050 bytes and got a minor speed increase (too noisy to give any distinct figures, but it was faster by 3-30%). I guess there is less chance of fragmentation in the heap too.
I tested the table stress case which has 40000 frames and calls FrameArena::AllocateFrame 143142 times. With the current default size I got 145 to 170 ms with most numbers being between 145 and 150 ms. With a slightly lower default size I got 125-145 ms with most numbers being between 135 and 145 ms. I got no real difference in memory usage but VM Size seemed to increase somewhat when I lowered the allocation size. (When I tried a default allocation size of 8160 it decreased slightly - strange)
> too noisy to give any distinct figures You have a bunch of numbers, right? Just quoting the means and standard deviations may be helpful to see what sort of speedup we're looking at.
4196: 930 ms (hard swapping I guess) 168 ms 153 ms 145 ms 145 ms 143 ms 4150-4170: 221 ms 145 ms 140 ms 138 ms 135 ms 124 ms 8160: 92 ms
Keywords: perf
Moving over to my list... unless you want to own this, Daniel?
Assignee: karnaze → dbaron
Priority: -- → P1
Target Milestone: --- → mozilla0.9.3
Status: NEW → ASSIGNED
You take it. You have probably better overview of the consequences of changing the value.
Ok, then next milestone since I don't have time to fiddle with it to figure out the best size.
Target Milestone: mozilla0.9.3 → mozilla0.9.4
I made a program that measured the time to allocate different block sizes and as far as I could tell the time was linear to the block size, so on Windows it might not make any difference for performance after all. Curiously, freeing memory was many times slower than allocating memory.
Target Milestone: mozilla0.9.4 → mozilla0.9.5
Target Milestone: mozilla0.9.5 → mozilla0.9.6
Target Milestone: mozilla0.9.6 → mozilla0.9.7
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → Future
QA Contact: chrispetersen → layout
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Priority: P1 → P3
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.