Your SlideShare is downloading. ×
0
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
asm.js
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

asm.js

659

Published on

asm.js에 대한 내용

asm.js에 대한 내용

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
659
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. asm.js전용우
  • 2. asm.js란?• 성능을 높일 수 있는 자바스크립트 서브셋JavaScriptasm.jsTypeScriptsupersetsubset
  • 3. 왜 asm.js가 HOT한가?• Mozilla와 Epic이 Unreal Engine3을 포팅
  • 4. Unreal Engine3의 포팅 processC++IR LinkJSWebGLEMScriptenLLVMClangasm.js
  • 5. asm.js
  • 6. function DiagModule(stdlib, foreign, heap) {"use asm";// Variable Declarationsvar sqrt = stdlib.Math.sqrt;// Function Declarationsfunction square(x) {x = +x;return +(x*x);}function diag(x, y) {x = +x; y = +y;return +sqrt(square(x) + square(y));}return { diag: diag };}Math WebGL heapvar diag = DiagModule({ Math: Math }).diag;alert(diag(10, 100));
  • 7. asm.js의 특징• 모든 브라우저에서 동작• 제한된 타입(숫자)만 가능 (링크)• 직접 heap을 만들어서 메모리 관리 (링크)
  • 8. 왜 성능이 좋은가?• 고정타입– e|0 (integer), +a(double)– 엔진에서는 “use asm”이라고 되어 있으면타입이 정적이라고 판단하여 AOT컴파일(ahead-of-time compile)함.• 메모리를 직접 관리– heap을 구현하여 malloc과 free와 유사하게 관리
  • 9. 그럼, 만들어 볼까요?function asmTest(){"use asm";}
  • 10. asm.js는 사람이 개발하는 코드가 아님
  • 11. asm.js는 주로 컴파일 된 코드emscriptenLLJSCoffeeScriptTypeScriptDartasm.jspyjamasGWTScript#
  • 12. 한계• 여전히 느린 성능• 웹 개발하고는 거의 상관없음• 굉장히 static함• 개발과 디버깅 언어가 다름• 결과가 JS일뿐 바이트 코드에 가깝다• 차라리 JS개발의 성능을 올리는 게 좋다
  • 13. 차세대 웹 게임의 가능성을 보여줌
  • 14. 감사합니다
  • 15. Resource• http://ejohn.org/blog/asmjs-javascript-compile-target/• http://kripken.github.io/mloc_emscripten_talk• http://gigazine.net/news/20130322-firefox-asmjs/• https://blog.mozilla.org/luke/2013/03/21/asm-js-in-firefox-nightly/• http://kripken.github.io/ammo.js/examples/new/ammo.html• http://jlongster.com/Compiling-LLJS-to-asm.js,-Now-Available-• http://blog.izs.me/post/10213512387/javascript-is-not-web-assembly• https://github.com/tonyg/js-nacl#readme• http://mrale.ph/blog/2013/03/28/why-asmjs-bothers-me.html• https://news.ycombinator.com/item?id=5456506• https://news.ycombinator.com/item?id=5455045• https://twitter.com/mraleph/status/317230108849098752• http://mbebenita.github.io/LLJS/• https://news.ycombinator.com/item?id=5486605• https://blog.mozilla.org/javascript/2013/04/05/the-baseline-compiler-has-landed/• http://kripken.github.io/mloc_emscripten_talk/gindex.html• http://engineering.imvu.com/2013/04/05/multiplatform-c-on-the-web-with-emscripten/• http://blog.brackets.io/2013/04/05/typeaware-javascript-code-intelligence/

×