Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis
Last active January 29, 2020 02:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cellularmitosis/d0b511abc9d0d7a2d80ee4214e21b5fe to your computer and use it in GitHub Desktop.
Save cellularmitosis/d0b511abc9d0d7a2d80ee4214e21b5fe to your computer and use it in GitHub Desktop.
Using bzip2 to compare the relative performance of various computers

Blog 2019/2/20

<- previous | index | next ->

Using bzip2 to compare the relative performance of various computers

Summary:

relative performance all machines

relative performance 1mb bzip2

relative performance 10mb bzip2

The 1MB bzip2 benchmark

Just a simple benchmark to get a rough comparison of CPU power in various machines.

Technique

(Linux:)

  1. Create a 1MB file of random data:
$ dd if=/dev/urandom of=/tmp/urandom bs=1M count=1

(for Mac, use bs=1m rather than bs=1M)

  1. Time how long it takes to pipe the file through the bzip2 compression utilitiy:
$ time cat /tmp/urandom | bzip2 > /dev/null

(Run that a few times to ensure the random file is cached in RAM)

Results

Linksys NSLU2

The NSLU2 was a Linux-based home NAS-appliance from 2004.

linksys-nslu2

266MHz ARMv5, 32MB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m10.187s
user  0m9.810s
sys   0m0.360s

cpuinfo:

$ cat /proc/cpu
cat: /proc/cpu: Is a directory
cell@nslu2:/tmp$ cat /proc/cpuinfo 
Processor	: XScale-IXP42x Family rev 1 (v5l)
BogoMIPS	: 265.42
Features	: swp half thumb fastmult edsp 
CPU implementer	: 0x69
CPU architecture: 5TE
CPU variant	: 0x0
CPU part	: 0x41f
CPU revision	: 1

Hardware	: Linksys NSLU2
Revision	: 0000
Serial		: 0000000000000000

OLPC XO-1

The OLPC XO-1 was a 2007 laptop designed for 3rd-world education markets.

xo-beta1-mikemcgregor-2

433MHz AMD Geode (i586), 256MB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m5.200s
user  0m5.100s
sys   0m0.080s

cpuinfo:

$ cat /proc/cpuinfo 
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 5
model		: 10
model name	: Geode(TM) Integrated Processor by AMD PCS
stepping	: 2
cpu MHz		: 430.951
cache size	: 128 KB
fdiv_bug	: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu de pse tsc msr cx8 sep pge cmov clflush mmx mmxext 3dnowext 3dnow
bogomips	: 861.90
clflush size	: 32
cache_alignment	: 32
address sizes	: 32 bits physical, 32 bits virtual
power management:

Raspberry Pi 1 Model B

The Raspberry Pi 1 Model B was a 2012 single-board computer.

11546-01

700MHz ARMv6, 512MB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m4.037s
user  0m3.916s
sys   0m0.112s

cpuinfo:

$ cat /proc/cpuinfo 
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 2.00
Features	: half thumb fastmult vfp edsp java tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2708
Revision	: 000e
Serial		: 000000002738b988

Pogoplug Series 4

Pogoplug Inc. offered a cloud-based service which made a hard-drive in your home available over the internet. The Pogoplug V4 itself was the hardware widget which served as the bridge between your hard-drive and Pogoplug Inc's cloud service.

Since becomming obsolete, this widget is now of interest to Linux hobbyists as a sub-$10 Linux box.

pogoplugmobile2

800MHz ARMv5, 128MB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m3.392s
user  0m3.290s
sys   0m0.100s

cpuinfo:

$ cat /proc/cpu
cat: /proc/cpu: Is a directory
root@pogo4:/tmp# cat /proc/cpuinfo 
processor	: 0
model name	: Feroceon 88FR131 rev 1 (v5l)
BogoMIPS	: 795.44
Features	: swp half thumb fastmult edsp 
CPU implementer	: 0x56
CPU architecture: 5TE
CPU variant	: 0x2
CPU part	: 0x131
CPU revision	: 1

Hardware	: Marvell Kirkwood (Flattened Device Tree)
Revision	: 0000
Serial		: 0000000000000000

Raspberry Pi Zero W

The Raspberry Pi Zero W is a single-core inexpensive version of the Raspberry Pi with built-in Wifi, from 2017.

raspberry-pi-zero-1

1GHz ARMv6, 512MB RAM

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m2.945s
user  0m2.869s
sys   0m0.067s

cpuinfo:

$ cat /proc/cpuinfo 
processor	: 0
model name	: ARMv6-compatible processor rev 7 (v6l)
BogoMIPS	: 997.08
Features	: half thumb fastmult vfp edsp java tls 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xb76
CPU revision	: 7

Hardware	: BCM2835
Revision	: 9000c1
Serial		: 000000002bec3b37

Dell Inspiron Mini 10v

The Mini 10v was an inexpensive netbook from 2009.

inspiron-mini-nickelodeon-design5

1.6GHz Intel Atom (i686, 2 threads), 2GB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m1.404s
user  0m1.368s
sys   0m0.028s

cpuinfo:

$ cat /proc/cpuinfo 
processor	: 0
...
processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 28
model name	: Intel(R) Atom(TM) CPU N270   @ 1.60GHz
stepping	: 2
microcode	: 0x218
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 2
core id		: 0
cpu cores	: 1
apicid		: 0
initial apicid	: 0
fdiv_bug	: no
f00f_bug	: no
coma_bug	: no
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon pebs bts aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 xtpr pdcm movbe lahf_lm dtherm
bugs		:
bogomips	: 3191.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 32 bits physical, 32 bits virtual

Raspberry Pi 3 Model B

The Raspberry Pi 3 Model B is a 2016 single-board computer.

91zsu44 34l sx679

1.2GHz ARMv7 (quad-core), 1GM Ram.

$ time cat urandom | bzip2 > /dev/null
real  0m1.242s
user  0m1.240s
sys   0m0.000s

cpuinfo:

cell@raspberrypi:/tmp $ cat /proc/cpuinfo 
processor	: 0
...
processor	: 1
...
processor	: 2
...
processor	: 3
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 38.40
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

Hardware	: BCM2835
Revision	: a02082
Serial		: 00000000d4fc277f

The 10MB bzip2 benchmark

Same as the above, but using 10MB of random data to better measure faster CPU's.

Dell Inspiron Mini 10v

(See detailed description above)

$ time cat urandom | bzip2 > /dev/null
real  0m13.954s
user  0m13.844s
sys   0m0.128s

Raspberry Pi 3 Model B

(See detailed description above)

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m12.188s
user  0m12.090s
sys   0m0.090s

Dell Precision 390

The Dell Precision 390 was a 2006 workstation.

precision390

1.86GHz Intel Core 2 Duo (x86_64), 8GB RAM.

$ time cat urandom | bzip2 > /dev/null
real  0m3.273s
user  0m3.232s
sys   0m0.052s

cpuinfo:

$ cat /proc/cpuinfo 
processor	: 0
...
processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 15
model name	: Intel(R) Core(TM)2 CPU          6300  @ 1.86GHz
stepping	: 2
microcode	: 0x5d
cpu MHz		: 1862.049
cache size	: 2048 KB
physical id	: 0
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm lahf_lm kaiser tpr_shadow dtherm
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 3724.09
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual

HP ProBook 4530s

The HP ProBook 4530s was a 2011 business laptop.

s-l640

2.3GHz Intel i3-2350M (x86_64), 4GB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m2.427s
user  0m2.424s
sys   0m0.016s

cpuinfo:

cell@hp$ cat /proc/cpuinfo 
processor	: 0
...
processor	: 1
...
processor	: 2
...
processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
stepping	: 7
microcode	: 0x1a
cpu MHz		: 799.890
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 2
apicid		: 3
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx lahf_lm epb kaiser tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts
bugs		: cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf
bogomips	: 4589.98
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual

Macbook Pro (Mid-2012)

_dsc8038

2.7GHz Intel i7-3820QM (x86_64), 16GB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m1.533s
user  0m1.524s
sys   0m0.013s

Macbook Pro (Mid 2015)

zz2gxqo2sbpikwak large

2.2GHz Intel i7-4770HQ (x86_64), 16GB RAM.

$ time cat /tmp/urandom | bzip2 > /dev/null
real  0m1.476s
user  0m1.472s
sys   0m0.013s
@ddewaele
Copy link

ddewaele commented Jan 28, 2020

Follow up from the post on reddit : https://www.reddit.com/r/retrobattlestations/comments/eulwnf/installing_redhat_52_on_my_25yr_old_pentium_100/

Here is the output on my intel pentium 100 (Redhat 5.2 Apollo)
The /tmp folder is just a folder on the hard drive (not ram).
Output of the time command is a bit garbled....

Red Hat Linux release 5.2 (Apollo)
Kernel 2.0.36 on an i586

login: ddewaele
[ddewaele@localhost ddewaele]$ su -
Password:
[root@localhost /root]# dd if=/dev/urandom of=/tmp/r  bs=1048576 count=1
1+0 records in
1+0 records out

[root@localhost /root]# time cat /tmp/r | bzip2 /dev/null
bzip2: Input file /dev/null is not a normal file, skipping.
Command terminated by signal 13
0.00user 0.02system 0:00.03elapsed 64%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (76major+10minor)pagefaults 0swaps

[root@localhost /root]# time cat /tmp/r | bzip2 > /dev/null
0.00user 0.15system 0:21.42elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (332major+10minor)pagefaults 0swaps

[root@localhost /root]# time cat /tmp/r | bzip2 > /dev/null
0.01user 0.06system 0:21.31elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (77major+10minor)pagefaults 0swaps

[root@localhost /root]# time cat /tmp/r | bzip2 > /dev/null
0.00user 0.10system 0:21.30elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (77major+10minor)pagefaults 0swaps
[root@localhost /root]#

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