Skip to content

Instantly share code, notes, and snippets.

@joakimk
Last active March 25, 2025 10:42
Show Gist options
  • Save joakimk/3965517 to your computer and use it in GitHub Desktop.
Save joakimk/3965517 to your computer and use it in GitHub Desktop.
Single core cpu performance test

Single core cpu performance.

echo 'int main() { double i = 0; for(i = 0; i < 5000000000; i++) { 20%7 * i; } }' > /tmp/test.c && gcc /tmp/test.c -o /tmp/test && time /tmp/test && rm /tmp/test.c && rm /tmp/test

NOTE: It's not 100% reliable since it differs depending on compiler version.

Platform                   CPU                   Time
PC                         14g i7-14700k (2023)  7.2
DELL Latitude 7430 (2022)  12g i5-1235U          9.4
MacBookPro15,1 (Mid 2018)  i9 2.4 ghz            11.1 
iMac15,1 (Late 2014)       i7 4.0 ghz            11.7
Hetzner AX102              7950X3D 16C           11.8
Hetzner AX42               8700GE 16C            11.9
PC (Early 2016, i5 4690k)  i5 3.5 ghz            12.0
PC                         i7 4.0 ghz (OC)       12.2 (our CI box)
MacBook Pro (2018)         i7 2.2 ghz            12.3
PC (Windows)               Ryzen 7 7800X3D       12.3
EC2 (c5d.4xlarge)          Xeon 8275CL 3.0 ghz   12.6
PC (2020)                  3900X 3.8 ghz         12.9
iMac14,2 (Late 2013)       i7 3.5 ghz            13.0
MacBookPro15,1 (2019)      i9 2.4 GHz            13.0
iMac12,2 (Mid 2011)        i7 3.4 ghz            13.2
MacBook Pro (2017)         i7 3.5 ghz            13.2
PC                         i7 3.2 ghz            13.3 (our CI box)
MacBookPro15,1 (2019)      i9 2.4 GHz            13.0 (8 cores)
Hetzner AX41-NVMe          Ryzen 5 3600 6C       13.3
PC                         Ryzen 5950X 3.4 GHz   13.4 (16 cores)
EC2 (c5.2xlarge)           Xeon 8124M 3.0 ghz    13.4
EC2 (c5n.4xlarge)          Xeon 8124M 3.00GHz    13.4
Macbook Pro (Mid 2012)     i7 2.9 ghz            14.2
MacBookPro8,1 (Early 2011) i7 2.7 ghz            14.8
Macmini6,2 (Late 2012)     i7 2.3 ghz            14.9
EC2 (c6g.4xlarge)          AWS Graviton2         15.0
MacBookAir5,2 (Mid 2012)   i7 2.0 ghz            15.2
MacBookPro11,1 (Late 2013) i7 2.8 ghz            15.3 # Odd result, needs retest, ought to be faster
PC                         i3 3.6 ghz (OC)       15.3
Raspberry Pi 5                                   15.7
PC                         i3 3.4 ghz (OC)       16.2
Heroku performance-l       Xeon 8375C 2.9 ghz    16.7 # 16.7 - 19.6
Macbook Air (Mid 2011)     i7 1.8 ghz            16.8
EC2 (c5a.4xlarge)          AMD EPYC 7R32         16.8
Macmini9,1 (2020)          Apple M1              17.8 (8 cores)
PC                         i3 2.9 ghz            18.8
Glesys OpenVZ                                    18.9    
Digitalocean droplet       QEMU 2ghz             21.6
EC2 (hi1.4xlarge)                                23.0
Macbook Air (Late 2010)    C2D 2.13 ghz          25.6
EC2 (c1.medium)                                  26.2
MacBook2,1 (~2006-2007)    C2D 1.83 ghz          27.3
Intel Compute Stick        Atom Z3735F 1.33 ghz  31.0
Raspberry Pi 4                                   36.7
Raspberry Pi 3             1.2ghz                58    # (same time running 4 in parallel, but not 5)
Raspberry Pi 2             0.9ghz                83.7
Rasberry Pi Model B Rev 2  0.7ghz                260.3      
@henrik
Copy link

henrik commented May 5, 2021

Getting the hardware identifier on a Mac:

system_profiler SPHardwareDataType | grep "Model Identifier"

Gives you e.g. "Model Identifier: MacBookPro15,1".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment