: Etherpad users! We are developing an extension that will allow you to create pages from etherpads quickly and easily. Please visit our sandbox and help us test it.


From MozillaWiki
Jump to: navigation, search


Possible further load-time optimizations

  • Move code generation off of parsing thread: bug 959263
  • PGAOT (Profile-Guided Ahead-of-Time Compilation):
    • Create a baseline asm.js compiler: super-fast codegen but with full static type info
    • Allow individual functions in an asm.js module to choose full or baseline (via "use" pragma on individual functions)
    • Allow Emscripten users to change default (full or baseline), hand-annotate, or do profiling to place pragmas.
  • Parse and AOT compile while downloading: bug 1061886
  • Remove async-script requirement for asm.js caching:
    • Maybe remove it from QuotaManager: bug 961057
    • More likely, just take (large) script parsing off the main thread: bug 1084009
  • asm.js parser: Avoid building an intermediate parse tree; type check during recursive descent bug 854061

Possible further throughput optimizations

Possible asm.js extensions that don't require new JS features

  • Zero-cost exception handling: bug 1065089
  • Extend asm.js to allow proper tail calls for all return types and do the tail-call optimization
  • Effectively support 'goto' (even computed 'goto') by formalizing a pattern of while+switch that gets compiled as if it was goto
  • Extend asm.js to better support dynamically linking asm.js modules (a mutable, callable array argument to asm.js module, like the PLT)
  • Add DataView to avoid the alignment mask on asm.js heap accesses (this is mostly a problem of DataView being slow in all browsers)

Proposed future JS features that would be useful to asm.js

  • int64 arithmetic: https://gist.github.com/BrendanEich/4294d5c212a6d2254703
  • ArrayBuffer.prototype.discard (bug 855669): to allow madvise(DONTNEED)
  • Typed Objects: (Typed Objects)
    • This feature comes with float32/uint64/int64 value types, which would be useful as scalar types in asm.js.
    • Formalize Typed Object "class declarations" in asm.js which could make asm.js a target for JVM/CLR/TypeScript (and allow these languages to reuse the builtin JS GC)
  • FunctionPromise: bug 854627, or perhaps just make some functions (asm.js, no-free-variables) structured-cloneable
  • Add way to programmatically observe whether asm.js validated: bug 952847

Usability improvements

Current asm.js spec bugs


Credit to John Howard