gecko-dev/js
Nicholas Nethercote 0e1cc95b5f Bug 1039965 - Avoid slop in JS arrays. r=bhackett,terrence.
This patch changes JS array resizing to always allocate power-of-two sized slot
requests. Previously it would mostly make slight-more-than-power-of-two sized
requests, which cause lots of slop.

Also, shrinkElements() now only does a reallocation if it would result in going
down a size class. E.g. if you pop all the elements from a 1000-element array,
it would realloc 999, then 998, then 997, all the way down the minimum size.
Now it does 512, then 256, down to the minimum size (which is 8).

I confirmed with DMD that the element allocations now have zero slop. This
reduces peak RSS loading a couple of large PDF files (four times each) with
pdf.js by 10s of MiBs.

--HG--
extra : rebase_source : 942c11de724843aa582e3a17b02043458a57e594
2014-07-17 21:14:20 -07:00
..
ductwork/debugger Bug 914753: Make Emacs file variable header lines correct, or at least consistent. DONTBUILD r=ehsan 2014-06-24 22:12:07 -07:00
examples Bug 914753: Make Emacs file variable header lines correct, or at least consistent. DONTBUILD r=ehsan 2014-06-24 22:12:07 -07:00
ipc Bug 950745 - Flag when we're processing urgent messages and disallow certain activities (r=bsmedberg,luke) 2014-07-17 21:09:45 -07:00
public Bug 993085 - Part 1: Add the Debugger.Memory.prototype.trackingAllocationSites accessor property r=jimb 2014-07-21 18:16:13 -07:00
src Bug 1039965 - Avoid slop in JS arrays. r=bhackett,terrence. 2014-07-17 21:14:20 -07:00
xpconnect Bug 1036790 - Only expect pjs methods for nightly builds in test_xrayToJS.xul. r=me 2014-07-20 16:15:22 -06:00