Another idea would be to compile this code on the server side as part of the build process. Then we don't care how fast the browsers are: they only see pure JavaScript. This brings up an interesting point: when doing C optimizations a pretty typical thing to do is to unroll loops and inline functions. Would this help any with JavaScript, given that loading time is fairly expensive compared to a local binary executable? Would be interesting to test this.