go-interpreter / wagon

wagon, a WebAssembly-based Go interpreter, for Go.
BSD 3-Clause "New" or "Revised" License
904 stars 148 forks source link

Add benchmarks for f32 & f64 operations. #128

Closed twitchyliquid64 closed 5 years ago

twitchyliquid64 commented 5 years ago
[xxx@xxx]:~/projects/wagon/exec> go test -bench=BenchmarkF github.com/go-interpreter/wagon/exec
goos: linux
goarch: amd64
pkg: github.com/go-interpreter/wagon/exec
BenchmarkF64Arithmetic10Interpreted-8         100000         14344 ns/op
BenchmarkF64Arithmetic10Native-8              300000          4343 ns/op
BenchmarkF32Arithmetic10Interpreted-8         100000         13365 ns/op
BenchmarkF32Arithmetic10Native-8              300000          4240 ns/op
PASS
ok      github.com/go-interpreter/wagon/exec    7.688s

Looks like the floating point operations are only ~3x faster instead of ~5x. I think this is attributable to missing operations for conversion from integer to float - hopefully I'll get around to that this weekend.

codecov-io commented 5 years ago

Codecov Report

Merging #128 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #128   +/-   ##
======================================
  Coverage    66.5%   66.5%           
======================================
  Files          41      41           
  Lines        4490    4490           
======================================
  Hits         2986    2986           
  Misses       1233    1233           
  Partials      271     271

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 83c8885...cbec603. Read the comment docs.

sbinet commented 5 years ago

this should have "improved" the benchmarks, right? :)

twitchyliquid64 commented 5 years ago

Dont think so, as processors arent much faster on 32bit floats than 64bit floats?

sbinet commented 5 years ago

my naive assumption was that pipelines would be somewhat more full.