Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
asm.js begins
Andrei Palchys
andrei@palchys.com
@apalchys
2008
TraceMonkey
V8
Nitro
Just-In-Time
2011
Emscripten
Emscripten
2013
asm.js
asm.js
an extraordinarily
optimizable, low-level
subset of JavaScript
Compatibility
Backward compatible with
vanilla* JavaScript
* vanilla-js.com – the best JS framework ever
Memory
Manual Memory
Management
Type System
- Type system:
integer
double
- Typed Functions
function ArithmeticModule(global, foreign, heap) {
"use asm";
function square(x) {
x = x|0;
return (x * x)|0;
}
function m...
var _ = 0, N = 0, M = 0, final = 0, buf = 0, t = 0, i = 0, $SP = 0;
U4[1] = (U4[1] | 0) - 32768;
$SP = U4[1] | 0;
N = 1638...
Supported browsers
Firefox 22
OdinMonkey
Performance
Future
- LLJS
- Extended Type System
- Other JS Engines(Chrome ?)
- Improve performance
Andrei Palchys
andrei@palchys.com
@apalchys
Upcoming SlideShare
Loading in …5
×

Asmjs

741 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Asmjs

  1. 1. asm.js begins Andrei Palchys andrei@palchys.com @apalchys
  2. 2. 2008 TraceMonkey V8 Nitro
  3. 3. Just-In-Time
  4. 4. 2011 Emscripten
  5. 5. Emscripten
  6. 6. 2013 asm.js
  7. 7. asm.js an extraordinarily optimizable, low-level subset of JavaScript
  8. 8. Compatibility Backward compatible with vanilla* JavaScript * vanilla-js.com – the best JS framework ever
  9. 9. Memory Manual Memory Management
  10. 10. Type System - Type system: integer double - Typed Functions
  11. 11. function ArithmeticModule(global, foreign, heap) { "use asm"; function square(x) { x = x|0; return (x * x)|0; } function multiply(x, y) { x = +x; y = +y; return +(x * y); } return {square: square, multiply: multiply}; }
  12. 12. var _ = 0, N = 0, M = 0, final = 0, buf = 0, t = 0, i = 0, $SP = 0; U4[1] = (U4[1] | 0) - 32768; $SP = U4[1] | 0; N = 16384; M = 200; final = 0; _; for (t = 0; (t | 0) < (M | 0); t = (t | 0) + 1 | 0) { for (i = 0; (i | 0) < (N | 0); i = (i | 0) + 1 | 0) { U1[((($SP) >> 0) + i) >> 0] = (((i | 0) + (final | 0) | 0 | 0) % 256 | 0) & 255; } for (i = 0; (i | 0) < (N | 0); i = (i | 0) + 1 | 0) { final = ((final | 0) + (U1[((($SP) >> 0) + i) >> 0] >>> 0) | 0) & 1; } https://github.com/jlongster/LLJS/blob/asm.js/test/asm/bench2.js
  13. 13. Supported browsers Firefox 22 OdinMonkey
  14. 14. Performance
  15. 15. Future - LLJS - Extended Type System - Other JS Engines(Chrome ?) - Improve performance
  16. 16. Andrei Palchys andrei@palchys.com @apalchys

×