akopytov / sysbench

Scriptable database and system performance benchmark
GNU General Public License v2.0
5.99k stars 1.07k forks source link

Apple M1 too fast? #389

Open andyrosa2 opened 3 years ago

andyrosa2 commented 3 years ago

I use: sysbench cpu --threads=16 run

On an i7 on Ubuntu 20200810 under WSL1/WSL2/Docker, I'm getting about 10000 events/second. On an Apple 13" Mac Book Pro 2020 (Apple M1 silicon), from terminal, it runs as Intel under rosetta 2/arch x86_64. I am getting several orders of magnitude higher (about 3 million/second).

I attach one such run. sb.txt

Are the Apple results too high or the Windows results too low? I could not find a good reference on what "normal numbers" are. Please let me know if I can be of assistance. Btw, great program. Thank you!

riccardopiola commented 3 years ago

Its pretty worthless as a cpu benchmark, i got the following results:

I was gonna use this benchmark to compare the performance between the Pi and the Galaxy S6 but no way the Galaxy is over 80 times faster (and faster than my desktop)

andyrosa2 commented 3 years ago

Its pretty worthless as a cpu benchmark, i got the following results:

  • i7 3770k (WSL2): 7547 e/s
  • Samsung Galaxy S6 (UserLAnd): 9507 e/s
  • Raspberry Pi 3B+: 117 e/s

I was gonna use this benchmark to compare the performance between the Pi and the Galaxy S6 but no way the Galaxy is over 80 times faster (and faster than my desktop)

Thank you for confirming the range for an i7. We agree something might not be working right. Btw, if I were the author, I'd ignore users that call it worthless for X or Y. This free stuff, and we are all welcome to help.

amanpatel commented 1 year ago

Here is some numbers I can report:

sysbench cpu --cpu-max-prime=20000 --threads=8 run

m1 pro: 26,021,936 e/s
i7-10700 : 3,600 e/s

AWS m5a.2xlarge (amd epyc 7500 series):  2,000 e/s

Its about 7000% faster. compared to the i7.

I will run this on a AWS graviton processor and see what it comes up with.

AlexFihman commented 1 year ago

m1 pro: 26,021,936 e/s

I got 8669 e/s with 1 thread on Ubuntu in Parallels on m1. So it looks like compilation problem on homebrew

buzzy commented 9 months ago

Well, it all depends on exactly HOW the software benchmarks. For example, it might be doing floating point calculations to check the speed and M1 might use the AI cores for that, which would give you those kind of numbers. It's like running it on a GPU.

tuxayo commented 9 months ago

M1 might use the AI cores for that

A Galaxy S6 doesn't have neural networks acceleration. And elsewhere I also saw that some Raspberry Pi had also way too high results.

tuxayo commented 9 months ago

Can someone else confirm that this the code for CPU tests? https://github.com/akopytov/sysbench/blob/2ca9e3f81fa7f89203fbff44388736dd6720819c/src/tests/cpu/sb_cpu.c#L97

My guess is that the whole loop is optimized away or partially. (it would be way faster if it was totally optimized away) Because nothing is done with n. Should just returning n be enough?

I don't know what that would do there, that's the call, right? https://github.com/akopytov/sysbench/blob/2ca9e3f81fa7f89203fbff44388736dd6720819c/src/tests/cpu/sb_cpu.c#L55

buzzy commented 9 months ago

Probaby ask this guy: Copyright (C) 2004-2018 Alexey Kopytov akopytov@gmail.com

tuxayo commented 9 months ago

I was hoping to save their time and attention for the next steps to review merge an eventual pull request and make a new release of the software.

For now, anyone with an intermediate level of C++ can help and hopefully there is such a person passing by this ticket. So let's try that before trying to directly contact the maintainer which might not have much availability.

buzzy commented 9 months ago

I was hoping to save their time and attention for the next steps to review merge an eventual pull request and make a new release of the software.

For now, anyone with an intermediate level of C++ can help and hopefully there is such a person passing by this ticket. So let's try that before trying to directly contact the maintainer which might not have much availability.

Sure, that makes sense. Please let me know when you have made a MR and I will take a look. Thanks!

tuxayo commented 9 months ago

Sure, that makes sense. Please let me know when you have made a MR and I will take a look. Thanks!

For now I need some confirmations on the second part of https://github.com/akopytov/sysbench/issues/389#issuecomment-1823790006