1
0
forked from Mirror/wren

Restyle site.

This commit is contained in:
Bob Nystrom
2014-08-19 07:35:20 -07:00
parent acceea2206
commit d5f68d70f0
8 changed files with 176 additions and 196 deletions

View File

@ -138,7 +138,7 @@ On compilers that support it, Wren's core bytecode interpreter loop uses somethi
Doing that using an actual `switch` confounds the CPU's [branch predictor](http://en.wikipedia.org/wiki/Branch_predictor): there is basically a single branch point for the entire interpreter. That quickly saturates the predictor and it just gets confused and fails to predict anything, which leads to more CPU stalls and pipeline flushes.
Using computed gotos gives you a separate branch point at the end of each instruction. Each gets its own branch prediction, which oftens succeed since some instruction pairs are more common than others. In my rough testing, this made a 5-10% performance difference.
Using computed gotos gives you a separate branch point at the end of each instruction. Each gets its own branch prediction, which often succeeds since some instruction pairs are more common than others. In my rough testing, this makes a 5-10% performance difference.
### A single-pass compiler