zs3.me

Diviner big-number math benchmark

Revision 15
© 2015-2019, 2021-2024 by Zack Smith. All rights reserved.

Diviner

Diviner is a benchmark that measures how fast a CPU can perform big-number unsigned integer division, using my own assembly language division routines.

Diviner currently measures the performance of bignum division for sizes of 256 bits up to 4 megabits.

The program actually generates assembly language code to suit the size of dividend and divisor.

I've written the assembly code only for 64-bit Intel/AMD CPUs (x86_64) but in future I'll add 64-bit ARM (aarch64).

What does it test?

This benchmark effectively tests the CPU's arithmetic processing speed, the caches' speed and in cases where the largest cache is small, the main memory speed.

Performance should be as follows:

  • Fastest: The in-registers-only division.
  • Fast: Divisions where the dividends and divisors fit entirely in the L1 cache.
  • Slower: Divisions where the dividends and divisors spill over into the L2 cache.
  • Slowest: Divisions with the larger operands, which spill over into the L3 cache (if one exists) or even main memory.

Output

AMD Ryzen 7 7840U, 5.1 GHz burst, 6400 MHz LPDDR5 RAM:

This CPU has a 512 kB L1 cache, 8MB L2 cache, and 16MB L3 cache, and it performed worse than the 5650U.

Dividend size divisor size divisions per second:
256-bit (registers) 128 6782000
256-bit (memory) 128 2311000
1024-bit (memory) 512 214600
4096-bit (memory) 2048 12990
16384-bit (memory) 8192 718.8
65536-bit (memory) 32768 43.70
262144-bit (memory) 131072 2.637
1048576-bit (memory) 524288 0.1593
4194304-bit (memory) 2097152 0.0094

AMD Ryzen 7 6850U, 4.7 GHz burst, 6400 MHz LPDDR5 RAM:

This CPU has a 512 kB L1 cache, 4MB L2 cache, and 16MB L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 5606000
256-bit (memory) 128 1747000
1024-bit (memory) 512 178000
4096-bit (memory) 2048 11980
16384-bit (memory) 8192 655.5
65536-bit (memory) 32768 39.72
262144-bit (memory) 131072 2.416
1048576-bit (memory) 524288 0.1375
4194304-bit (memory) 2097152 0.0079

AMD Ryzen 5 6650U, 4.5 GHz burst, 6400 MHz LPDDR5 RAM:

This CPU has a 384 kB L1 cache, 3MB L2 cache, and 16MB L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 5775000
256-bit (memory) 128 1672000
1024-bit (memory) 512 170600
4096-bit (memory) 2048 11510
16384-bit (memory) 8192 630.7
65536-bit (memory) 32768 38.31
262144-bit (memory) 131072 2.334
1048576-bit (memory) 524288 0.1342
4194304-bit (memory) 2097152 0.0076

AMD Ryzen 5 5650U, 4.2 GHz burst, 4267 MHz LPDDR4 RAM:

Dividend size divisor size divisions per second:
256-bit (registers) 128 5073000
256-bit (memory) 128 1590000
1024-bit (memory) 512 162200
4096-bit (memory) 2048 10940
16384-bit (memory) 8192 598.2
65536-bit (memory) 32768 36.28
262144-bit (memory) 131072 2.133
1048576-bit (memory) 524288 0.1096
4194304-bit (memory) 2097152 0.0065

Intel Core i5-1240P, 4.4 GHz burst, 4267 MHz LPDDR4 RAM:

This CPU has a 5 MB L2 cache per core, 12 MB shared L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 3055000
256-bit (memory) 128 1890000
1024-bit (memory) 512 97950
4096-bit (memory) 2048 4335
16384-bit (memory) 8192 244.2
65536-bit (memory) 32768 14.70
262144-bit (memory) 131072 0.9089
1048576-bit (memory) 524288 0.0566
4194304-bit (memory) 2097152 0.0032

Intel Core i5-1135G7, 4.2 GHz burst, 4267 MHz LPDDR4X RAM:

This CPU has an 8 MB shared L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 2878000
256-bit (memory) 128 1457000
1024-bit (memory) 512 81500
4096-bit (memory) 2048 4382
16384-bit (memory) 8192 250.4
65536-bit (memory) 32768 15.07
262144-bit (memory) 131072 0.9001
1048576-bit (memory) 524288 0.0568
4194304-bit (memory) 2097152 0.0033

Intel Core i5-8250U, 3.2 GHz burst, 2400 MHz DDR4 RAM:

This CPU has a 6 MB shared L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 2250000
256-bit (memory) 128 985000
1024-bit (memory) 512 55740
4096-bit (memory) 2048 3153
16384-bit (memory) 8192 190.3
65536-bit (memory) 32768 11.79
262144-bit (memory) 131072 0.7120
1048576-bit (memory) 524288 0.0417
4194304-bit (memory) 2097152 0.0024

Intel Core i5-5257U, 3.1 GHz burst, 1866 MHz LPDDR3 RAM:

This CPU has a 3 MB shared L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 1838000
256-bit (memory) 128 680000
1024-bit (memory) 512 46440
4096-bit (memory) 2048 2737
16384-bit (memory) 8192 163.6
65536-bit (memory) 32768 10.10
262144-bit (memory) 131072 0.5918
1048576-bit (memory) 524288 0.0276
4194304-bit (memory) 2097152 0.0012

Intel Core i5-4278U, 3.1 GHz burst, 1600 MHz DDR3L RAM:

This CPU has a 3 MB shared L3 cache.

Dividend size divisor size divisions per second:
256-bit (registers) 128 1434000
256-bit (memory) 128 663000
1024-bit (memory) 512 46800
4096-bit (memory) 2048 2742
16384-bit (memory) 8192 165
65536-bit (memory) 32768 10.23
262144-bit (memory) 131072 0.6206
1048576-bit (memory) 524288 0.0349
4194304-bit (memory) 2097152 0.0012

Download

1.0.2

Notes:

  • This requires the Unix 64-bit ABI therefore it doesn't run on Windows.
  • The assembly code utilizes loop unrolling and can be time-consuming to assemble.

1875417285