Faster update() by compiling to JS