standards - Explicit control of JavaScript JIT? -


i'm working on code (for audio processing) relies heavily on modern javascript optimization performance. dynamically generate js methods bunch of arithmetic on contents of int32arrays, , want these methods run fast possible. "magic" optimisation works pretty well, , have idea of how along, wonder if there ways improve on that.

it occurs me if had way tell javascript engine "this method run hot, , types of arguments should never change". way, (1) compiler potentially work sooner , better, , (2) if type of argument wrong, or optimization fails other reason, can exception instead of silently falling interpreter.

does know of standards or initiatives of kind? or failing that, there profiling tools see how code or isn't being optimised (in chrome, firefox , safari)?


update

regarding asm.js-- hadn't heard of that-- sounds cool, , has lot of tricks useful read kind of work.

as understand it, asm.js convention writing highly-optimizable javascript, rather new specification js engines. however, define way label compliant sections of code (by putting line "use asm"; @ beginning of method), intent future js engines respond , use special ahead-of-time (aot) compiler on sections, reporting errors console if code doesn't meet stricter standards regarding type safety etc.

afaict mozilla have started on aot compiler, , google talking seriously v8. can't find plans javascriptcore, , wouldn't hold breath regarding ie.

but kind of answer question, guess-- if generate code validates asm.js now, there's no downside, , in browsers of future might performance bump.

chrome's v8 engine has bunch of options type of debugging. think you'll find blog post useful:

optimizing v8 - introduction

(it's whole series of posts, can more advanced options if keep reading.)


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -