typed array filling convenience AND performance
sphink at gmail.com
Tue Nov 4 12:45:15 PST 2014
On 11/04/2014 11:08 AM, Brendan Eich wrote:
> Steve Fink wrote:
>> On a related note, I*would* like to have some way of getting the OS to
>> decommit memory. Seehttps://bugzilla.mozilla.org/show_bug.cgi?id=855669
>> (start reading at about comment 22) for our discussion and attempt at
>> this, which looks like it mysteriously trailed off this lastMarch.
>> Theoretically, the above loop could also trigger a decommit, but I think
>> it's too much to expect the engine to guess when that's going to be a
>> good idea. On the other hand, from a spec POV it's unobservable
>> behavior, which makes it weird.
> (https://gist.github.com/andhow/95fb9e49996615764eff) is an ES7 stage
> 0 proposal, needs to move to stage 1 soon. It enables decommitting
I'm not sure we're talking about the same thing. I'm talking about what
would be madvise(MADV_DONTNEED) on POSIX or VirtualAlloc(MEM_RESET) on
Windows. Er... actually, I think it would be MEM_RESET followed by
MEM_COMMIT to get the zero-filling while still releasing the physical pages.
Unless there's some tricky way of using ArrayBuffer.transfer to signal
that memory can be decommitted, but I don't see it.
More information about the es-discuss