by hughw · 10y ago · 0 comments
My question isn't silly. I just now wrote two short programs, one in Go and one Javascript, to run a vector multiply and add on two length 1000 vectors, a million times. The JS program is faster.
Result (in seconds):
$ node vmadd.js
0.984
$ go run vmadd.go
1.141044662
JS code:
https://gist.github.com/hwinkler/62c9da0d9f2d8c7981b0Go code: https://gist.github.com/hwinkler/d234bb62b2c5fa081a50
$ go build vmadd.go
$ ./vmadd
1.106074715
This is a 2013 Core i7 15" MBP