kripken/emscripten — Issue #181: Optimize intertyper items
Author: kripken
Created: 2012-01-22 03:50:56+00:00
State: open
Labels: good first bug

Currently, the intertyper first generates tokens, then parses those into our internal types. A big source of inefficiency is that we start with an internal type object, then add properties to it. This makes it much harder for JS engines to optimize property accesses.

It should not be hard to optimize that, by making intertype items created all by a single constructor, that initializes all possible fields (not that many since we use standard names) to `null`. Checking if we did this right can be done by calling `Object.seal` which will make it impossible to add or delete properties on the object past that point.