Javascript performance patches