SlideShare a Scribd company logo
emscripten
                  aobench

Monday, January 24, 2011
Agenda
                    • emscripten
                    • aobench
                    •
                    • Performance
                    •

Monday, January 24, 2011
emscripten

                    • C/C++ -> JavaScript compiler
                    • LLVM IR JS
                     • clang, llvm-gcc         C/C++   LLVM
                           IR    .



Monday, January 24, 2011
aobench

                    • AmbientOcclusion       ,
                           CG

                    •
                                         .



Monday, January 24, 2011
• raytrace
                           .

                    • clang LLVM IR
                    • emscripten LLVM IR -> JS
                    • web
Monday, January 24, 2011
•
                           • compile    , js       .

                    •                  ...

                    • Firebug                  .




Monday, January 24, 2011
include file
                    • #include “emscripten.h”
                    • C/C++




Monday, January 24, 2011
• rand()                   .

                    •
                      • ->                 (
                                      ?)

                           xorshift

Monday, January 24, 2011
double *pixels = new double[3 * x];


                             @llvm.umul.with.overflow.i64

                                  ->




Monday, January 24, 2011
optimize

                    • opt -std-compile-opts   LLVM IR
                                         .

                           •     ...




Monday, January 24, 2011
js code
                    •       JS



                  var args = arguments;

                  //       arguments       .
                  // var args = []




Monday, January 24, 2011
Performance
                                         Chrome          Firefox

                                   90

           • Chrome 12.8 secs     67.5

           • Firefox 82.92 secs    45

           • Safari       ...     22.5

                                    0
                                                  secs




Monday, January 24, 2011
Closure compiler


                    • Closure compiler(JS -> JS optimizer)
                                JS
                                     .




Monday, January 24, 2011
•      JS                 JS
                                      .

                    •      C    JS
                                          .

                    •      LLVM IR

                    •      lowlevel


Monday, January 24, 2011

More Related Content

PDF
Hackersnl
PDF
A Deep Dive into Javascript
PDF
Momads explained @ Brave New Radio
PDF
Cloud4all Architecture Overview
PDF
Buildout talk
PDF
Using+javascript+to+build+native+i os+applications
PDF
Writing jQuery that doesn't suck - London jQuery
PPTX
Going to the zoo
Hackersnl
A Deep Dive into Javascript
Momads explained @ Brave New Radio
Cloud4all Architecture Overview
Buildout talk
Using+javascript+to+build+native+i os+applications
Writing jQuery that doesn't suck - London jQuery
Going to the zoo

More from Syoyo Fujita (10)

PDF
PDF
Docker + GCE + etcd + ray tracing
PDF
Docker infiniband
KEY
DIY InfiniBand networking
ZIP
MicroServer + InfiniBand + ZFS
KEY
PDF
Rsltollvm
PDF
Vertex Culling illustration at SBR07
PDF
First Order
PDF
Muda Proposal
Docker + GCE + etcd + ray tracing
Docker infiniband
DIY InfiniBand networking
MicroServer + InfiniBand + ZFS
Rsltollvm
Vertex Culling illustration at SBR07
First Order
Muda Proposal
Ad

AObench with Emscripten

  • 1. emscripten aobench Monday, January 24, 2011
  • 2. Agenda • emscripten • aobench • • Performance • Monday, January 24, 2011
  • 3. emscripten • C/C++ -> JavaScript compiler • LLVM IR JS • clang, llvm-gcc C/C++ LLVM IR . Monday, January 24, 2011
  • 4. aobench • AmbientOcclusion , CG • . Monday, January 24, 2011
  • 5. • raytrace . • clang LLVM IR • emscripten LLVM IR -> JS • web Monday, January 24, 2011
  • 6. • compile , js . • ... • Firebug . Monday, January 24, 2011
  • 7. include file • #include “emscripten.h” • C/C++ Monday, January 24, 2011
  • 8. • rand() . • • -> ( ?) xorshift Monday, January 24, 2011
  • 9. double *pixels = new double[3 * x]; @llvm.umul.with.overflow.i64 -> Monday, January 24, 2011
  • 10. optimize • opt -std-compile-opts LLVM IR . • ... Monday, January 24, 2011
  • 11. js code • JS var args = arguments; // arguments . // var args = [] Monday, January 24, 2011
  • 12. Performance Chrome Firefox 90 • Chrome 12.8 secs 67.5 • Firefox 82.92 secs 45 • Safari ... 22.5 0 secs Monday, January 24, 2011
  • 13. Closure compiler • Closure compiler(JS -> JS optimizer) JS . Monday, January 24, 2011
  • 14. JS JS . • C JS . • LLVM IR • lowlevel Monday, January 24, 2011