flatjs icon indicating copy to clipboard operation
flatjs copied to clipboard

Chrome performance issue (ray tracer)

Open lars-t-hansen opened this issue 9 years ago • 0 comments

The flatjs code for the ray tracer is significantly slower in Chrome (on one core) than the plain JS code. This is remarkable - and it is the reason I'm pitching it as a Chrome issue - because in Firefox, the flatjs code is about 25% faster than the plain JS code, which is somewhat "as expected".

Reasons could be:

  • poor optimization around typed arrays (range checking, type propagation)
  • slow access to global variables and no commoning (since every access to flat memory names the array to load from, as a global), or poor information about types of global variables
  • much slower calls via global objects (since each call mentions the type name as an object and calls indirect via it, not going via "this", see Issue #28)

(Late-2013 MacBook Pro 2.6GHz i7, OS X 10.10, Chrome 43, FF m-i 41. Actual numbers forthcoming.)

lars-t-hansen avatar Jun 08 '15 09:06 lars-t-hansen