Benchmarks

Mac Benchmark: SHA-256 Hashing (x25)

Secure Hash Algorithm 2 (SHA-2) is a family of widely used cryptographic hash functions. SHA-256, its most popular variant, produces a 256-bit (32-byte) hash value. It is commonly used to verify the integrity of data. This benchmark measures the time taken to hash 25 strings using the SHA-256 algorithm.

string encryption

All-Time Rankings

Rank Language Average Time Best Time Worst Time
1 Go 18.160µs 15.000µs 32.000µs
2 PHP 26.606µs 23.337µs 83.800µs
3 C (Clang) 38.927µs 37.273µs 43.587µs
4 C (GCC) 39.912µs 37.875µs 41.683µs
5 Python 44.640µs 43.000µs 53.000µs
6 Rust 84.680µs 81.000µs 114.000µs
7 Zig 97.320µs 94.000µs 114.000µs
8 C++ (G++) 186.360µs 180.000µs 219.000µs
9 C++ (Clang++) 337.775µs 307.211µs 561.799µs
10 Kotlin (Native) 496.637µs 390.826µs 950.498µs
11 JavaScript (Deno) 2,028.898µs 1,557.166µs 4,023.179µs
12 GraalVM 3,775.172µs 136.284µs 88,621.808µs
13 Ruby 28,701.560µs 906.000µs 691,770.000µs
14 JavaScript (Bun) 51,371.821µs 2,086.922µs 948,890.164µs
15 JavaScript (Node) 81,598.593µs 1,383.108µs 1,010,718.259µs
16 Java 465,945.865µs 19,934.153µs 1,335,334.204µs
17 Kotlin (JVM) 1,368,542.550µs 47,892.201µs 3,617,505.242µs

Average Times

Median Times

Best-Case Scenario Times

Worst-Case Scenario Times