Skip to content

Commit e8cf540

Browse files
committed
Remove educated guesses/assumptions that are likely false.
Thanks @peggyl for helping research. Minor other tweaks.
1 parent 77bbc91 commit e8cf540

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

_posts/blog/2015-09-28-surprises-in-gopherjs-performance.mdown

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,14 @@ sys 0m0.004s
250250
```
251251

252252
Nice, it's the same time as the Go and GopherJS versions.
253-
So that means a few things.
253+
That means a few things.
254254

255-
The V8 JavaScript Engine is incredible.
255+
The V8 JavaScript engine is incredible.
256256
It's able to take Go code that is compiled to JavaScript code, and just-in-time compile to it to machine instructions that are as efficient as the native Go compiler.
257257

258-
The JavaScript `Math.pow` implementation clearly has a fast-path for when value of x is -1 and values of y are integers.
259-
So for those inputs, it's faster.
260-
Using `Pow` with such inputs is silly and should not be done, as you can see by the 50 million to 1 billion iteration increase when rewriting it with an equivalent if statement.
261-
Go chooses not to have a fast path for such inputs, which makes it faster in the general case, and I'm glad it makes that choice.
258+
The JavaScript `Math.pow` implementation is faster when value of x is -1 and values of y are integers.
259+
I haven't compared its performance for other inputs; let me know if you do.
260+
However, using `Pow` with such inputs is silly and should not be done, as you can see by the 50 million to 1 billion iteration increase when rewriting it with an equivalent if statement.
262261

263262
You can try the final optimized version of GopherJS in your browser via the GopherJS Playground:
264263

0 commit comments

Comments
 (0)