News for hackers. Stuff that matters.
Re:Optimizations on Linear Search (2016) by gautamcgoel on Saturday October 03, 2020 @02:36PM (#24673833)
Wait, are you saying that C is 50 times faster than Go? I find that very hard to believe. I could buy 3-4 times faster, especially if the C code is vectorized and the Go code is not, but 50-100x seems unrealistic IMO. Do you have any benchmarks to back up your claim?
Re:Optimizations on Linear Search (2016) by johndough on Saturday October 03, 2020 @05:32PM (#24674818)
https://ideone.com/T56tDZ I get close to 5 GB/s with this online IDE and twice that on my 6 year old laptop, which is roughly a factor of 20 to 40 faster than 250 MB/s. A factor of 100 sounds plausible with more modern RAM or larger cache size.
Re:Optimizations on Linear Search (2016) by gautamcgoel on Saturday October 03, 2020 @06:17PM (#24675092)
You only benchmarked the C code. In order to get an apples to apples comparison, you have to benchmark the Go code on the same hardware - your comment compares the runtimes of two different implementations on different hardware.
Re:Optimizations on Linear Search (2016) by formerly_proven on Saturday October 03, 2020 @05:41PM (#24674866)
> Wait, are you saying that C is 50 times faster than Go?

Are you saying you need 50 clock cycles to compare two integers?

Re:Optimizations on Linear Search (2016) by gautamcgoel on Saturday October 03, 2020 @06:15PM (#24675084)
...no? What made you think that?
Re:Optimizations on Linear Search (2016) by richieartoul on Saturday October 03, 2020 @06:47PM (#24675242)
Its hard to believe because its dead wrong. See my benchmark above.
Re:Optimizations on Linear Search (2016) by gautamcgoel on Sunday October 04, 2020 @11:06PM (#24684198)
Yeah what OP wrote is complete nonsense. Sad that this stuff bubbles to the front of HN and then gets quoted endlessly...