-
Notifications
You must be signed in to change notification settings - Fork 188
Optimizations
hhugo edited this page Apr 21, 2020
·
2 revisions
- do not change shape of JavaScript value.
- https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
Outdated since https://github.com/v8/v8/commit/b0bcee3e62f67d2cf5cc8627a47accce42981605.
V8 bailout when switches contains more than 128 case.
Js_of_ocaml splits big switches with conditionals. Use "-set switch_size=limit"
to the maximum number of cases.
-
Some constructs are not being optimized by JIT compilers (eval, try_catch). Js_of_ocaml tries to preserve optimizable function by not inlining such not-optimized constructs (see https://github.com/ocsigen/js_of_ocaml/pull/230)
-
Some constructs containing constants are not being optimized if those constants are aliased by variables. Js_of_ocaml doesn't alias
"number"
constant string so thattypeof x === "number"
gets optimized. The same for constant patterns in switch case.