ݺߣ

ݺߣShare 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 ?le
                    ? #include emscripten.h
                    ? C/C++




Monday, January 24, 2011
? rand()                   .

                    ?
                      ? ->                 (
                                      ?)

                           xorshift

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


                             @llvm.umul.with.over?ow.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

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 ?le ? #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.over?ow.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