SlideShare uma empresa Scribd logo
1 de 14
Baixar para ler offline
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

Mais conteúdo relacionado

Mais de Syoyo Fujita

Docker + GCE + etcd + ray tracing
Docker + GCE + etcd + ray tracingDocker + GCE + etcd + ray tracing
Docker + GCE + etcd + ray tracingSyoyo Fujita
 
DIY InfiniBand networking
DIY InfiniBand networkingDIY InfiniBand networking
DIY InfiniBand networkingSyoyo Fujita
 
MicroServer + InfiniBand + ZFS
MicroServer + InfiniBand + ZFSMicroServer + InfiniBand + ZFS
MicroServer + InfiniBand + ZFSSyoyo Fujita
 
Vertex Culling illustration at SBR07
Vertex Culling illustration at SBR07Vertex Culling illustration at SBR07
Vertex Culling illustration at SBR07Syoyo Fujita
 

Mais de Syoyo Fujita (10)

Herd
HerdHerd
Herd
 
Docker + GCE + etcd + ray tracing
Docker + GCE + etcd + ray tracingDocker + GCE + etcd + ray tracing
Docker + GCE + etcd + ray tracing
 
Docker infiniband
Docker infinibandDocker infiniband
Docker infiniband
 
DIY InfiniBand networking
DIY InfiniBand networkingDIY InfiniBand networking
DIY InfiniBand networking
 
MicroServer + InfiniBand + ZFS
MicroServer + InfiniBand + ZFSMicroServer + InfiniBand + ZFS
MicroServer + InfiniBand + ZFS
 
MUDA
MUDAMUDA
MUDA
 
Rsltollvm
RsltollvmRsltollvm
Rsltollvm
 
Vertex Culling illustration at SBR07
Vertex Culling illustration at SBR07Vertex Culling illustration at SBR07
Vertex Culling illustration at SBR07
 
First Order
First OrderFirst Order
First Order
 
Muda Proposal
Muda ProposalMuda Proposal
Muda Proposal
 

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