google chrome - How can I tell what javascript has been compiled when running V8 -
i have herd v8 compiles "hot code" optimise javascript performance. there way can tell code has been compiled , code has not?
first , foremost need profile code in profiles tab of javascript console in chrome see worth testing. if function, module, or whatever trying test not take time, won't worth effort.
v8's jit going make assumptions code, if assumptions true code lightning fast. if not v8 deoptimize code program continues. here instance own tests. in code below testing merge sort function had written.
console.time('order'); msort(ob); console.timeend('order'); the first run of 60000 random numbers completes after 8ms, , of following jump around 16ms. jit has issues wrote recompiled code. have seen exact opposite occur code jumps twice fast. if want @ it, not exact version, 1 using es6 module syntax. https://github.com/jamesrhaley/es2015-babel-gulp-jasmine/blob/master/src/js/mergesort/mergesort.js
also if code not worth optimizing, won't optimized begin with. here couple of links helped me improve speed when writing js.
Comments
Post a Comment