Re:Optimizations on Linear Search (2016)
by Jtsummers on Saturday October 03, 2020 @06:41PM
(#24675210)
The author was running on a 2013 laptop, which had smaller cache and slower RAM than what you're probably using.
Benchmark comparisons are useless without running on equivalent hardware.
Re:Optimizations on Linear Search (2016)
by richieartoul on Saturday October 03, 2020 @06:46PM
(#24675238)
He was probably scanning elements that were larger than int32s, even on a 2013 this code would run at Gib/s.
The point of my benchmark was that C is nowhere near 50-100x faster than Go and that the user I'm replying to shouldn't make unsubstantiated claims like that.
Re:Optimizations on Linear Search (2016)
by formerly_proven on Sunday October 04, 2020 @07:59AM
(#24678332)
My claim that the trivial C code is 100x faster than the number from the article is a) well substantiated b) all there is c) perfectly clear.
Re:Optimizations on Linear Search (2016)
by formerly_proven on Sunday October 04, 2020 @07:02AM
(#24677992)
> Go is not nearly as slow as you're making it seem to be
It's rather obvious I compared against the quoted figure.
b.ReportMetric(float64(b.N)float64(len(ints))4/1000/1000/1000, "GiB/s")
which leads to 9-10GiB/s on my laptop