C vs. Java Benchmark Tests

February 23, 2000

Updated: November 10, 2023

Gateway 2000: 200 MHz Pentium MMX with 64 Meg RAM (2000)
Operating System Compiler Virtual Machine Optimized Time (seconds) Graph of Time
Linux 2.2.5 egcs 2.91.66 None No 73
Yes 64
Sun jdk 1.2.2 Sun jdk 1.2.2 No 147
Yes 146
IBM jikes 1.06 148
Blackdown jre 1.2.2 RC4 86
kaffe 1.0.5 152
IBM jre 1.1.8 81
Sun jdk 1.2.2 w/
Inprise JIT 1.2.13
89
IBM jre 1.3.0 85
Windows NT 4.0
Service Pack 5
Visual C++ 6.0 None 64
Sun jdk 1.2.2 Sun jdk 1.2.2 79
HotSpot 1.0.1 79

Raspberry Pi 4 Model B: Cortex-A72 600-1500 MHz with 4 Gig RAM (2023)
Operating System Compiler Virtual Machine Optimized Time (seconds) vs Best 2000 Result
Linux 5.4.0 clang 10.0.0 llvm 10.0.0 No 0.526 122x
Yes 0.111 576x
gcc 9.4.0 None No 0.568 113x
Yes 0.117 547x
Temurin jdk 21.0.1 Temurin jre 21.0.1 0.168 381x

MacBook Pro: 2.2 GHz i7 with 16 Gig RAM (2023)
Operating System Compiler Virtual Machine Optimized Time (seconds) vs Best 2000 Result
MacOS Ventura 13.6.1 clang 15.0.0 llvm 15.0.0 No 0.108 592x
Yes 0.028 2286x
Corretto jdk 11.0.9.1 Corretto jre 11.0.9.1 0.045 1422x

MacBook Pro: M3 with 18 Gig RAM (2024)
Operating System Compiler Virtual Machine Optimized Time (seconds) vs Best 2000 Result
MacOS Sonoma 14.5 clang 15.0.0 llvm 15.0.0 No 0.060 1067x
Yes 0.015 4267x
Corretto jdk 22.0.1 Corretto jre 22.0.1 0.018 3556x

The C code and Java code are available.

Notes: