Big variations in benchmarking results ?

91 views
Skip to first unread message

christoph...@gmail.com

unread,
Apr 7, 2021, 1:26:56 PM4/7/21
to golang-nuts
Hello,

I'm benchmarking some code with my mac book air. The code is only computation and writing in a preallocated slice. I see big variations in the ns/op (e.g. 5000 to 8000). I disabled the turbo boost but the variations are still there.

To verify I tried the code benchmarking on an Ubuntu desktop computer and the variations are small (e.g. 4000 +/- 100 at most).

What could explain these variations ? Is there a way to avoid it ?

Robert Engels

unread,
Apr 7, 2021, 7:09:04 PM4/7/21
to christoph...@gmail.com, golang-nuts
OSX has a very different scheduler and often many more background processes. Also, you need to ensure you are running on the exact same chipset due to variations in cpu cache sizes and implementations. 

On Apr 7, 2021, at 12:27 PM, christoph...@gmail.com <christoph...@gmail.com> wrote:

Hello,


I'm benchmarking some code with my mac book air. The code is only computation and writing in a preallocated slice. I see big variations in the ns/op (e.g. 5000 to 8000). I disabled the turbo boost but the variations are still there.

To verify I tried the code benchmarking on an Ubuntu desktop computer and the variations are small (e.g. 4000 +/- 100 at most).

What could explain these variations ? Is there a way to avoid it ?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/01c4cc10-b602-4cad-b369-3e410b563c6an%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages