Bug 148267

Summary: Investigate asm.js memory growth perf
Product: WebKit Reporter: Alon Zakai <alonzakai>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: dtc-llvm, fpizlo
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fannkuch benchmark with memory growth
none
Fannkuch benchmark without memory growth none

Description Alon Zakai 2015-08-20 16:59:32 PDT
Created attachment 259529 [details]
Fannkuch benchmark with memory growth

Attached is an example benchmark of fannkuch compiled by emscripten with asm.js memory growth. That means that the typed arrays representing memory (HEAP8, etc.) are modifiable, we replace them when we resize memory. (This uses ArrayBuffer.transfer when present, but does not depend on that.)

This is efficient in Firefox and Edge, as part of asm.js validation and the AOT compilation approach. On Chrome it is known to be slow,

https://code.google.com/p/v8/issues/detail?id=3907

Filip asked me to file this issue here, to investigate performance in JavaScriptCore.

Note that memory growth is disabled by default in emscripten, so probably not much code out there uses it. If we can see that it's fast across the board, it would be nice to enable it, as it lets people compile their code without deciding ahead of time on the maximum amount of memory.
Comment 1 Alon Zakai 2015-08-20 17:34:01 PDT
Created attachment 259537 [details]
Fannkuch benchmark without memory growth

For comparison, Fannkuch without memory growth.