To compare the speed of all Linux computers I get my fingers on, I use a simple program to calculate n! (n<120000). The program was compiled with gcc, optimization enabled (-O2). Here are the results:

x86 25000! 50000! 100000!
i386 33 MHz 421s 1847s 8321s
i486 33 MHz 276s 1201s 5317s
i486DX2 66 MHz 143s 625s 2730s
PENTIUM 60 MHz 70s 302s 1357s
PENTIUM 100 MHz 43s 186s 819s
PENTIUM 133 MHz 32s 141s 630s
K6-2 333 MHZ 9s 38s
Duron 1000 MHz 2s 13s
Atom Z530 2.2s 9.5s 42s
XP@166*9 2s 5s 26s
Atom CPU Z3736F 1.2s 4.9s 19.4s
A64-3000+, SLAMD64 1s 4s 15s
A64-X2 3800, sflack 1s 3s 14s
Celeron N4100 0.55s 2.42s 10.43s
Celeron N4120 0.50s 2.17s 9.40s
Pentium B970 0.45s 1.91s 8.25s
Core i5-2400 0s 2s 6s
Epyc 7502 VServer 2,5GHz 260ms 1,020ms 4,410ms
Pentium G3420 300ms 1,020ms 4,240ms
Pentium G4500 230ms 900ms 3,980ms
Intel n100 228ms 858ms 3,734ms
Ryzen 5 5600G 41ms 520ms 2,150ms
RISC 25000! 50000! 100000!
SPARC 2 358s
SPARC 10 146s 633s 2738s
SPARC 20 116s 508s 2210s
ULTRA SPARC 167MHz 46s 206s 897s
ESP32-C3 160MHz Rust 39s 170s 733s
ESP32-C6 160MHz Rust 31s 137s 592s
Dreambox 250MHz -O3 19s 86s 374s
N800 330MHz -O3 17s 83s 352s
RPi 800MHz -O3 7s 37s 183s
M1s on FreeRTOS, BL808 6.3s 27.6s 119.2s
ingenic Xburst 1.2GHz -O3 4s 19s 84s
Xburst -O3 -mips32r2 3.8s 17.2s 75.4s
RPi 2 900MHz -O2=O3 4.4s 16.4s 66.4s
RK3066 ??1.3GHz -O3 2s 12s 54s
RK3188 1.6GHz -O2=03 2s 9s 40s
Orange Pi PC 1.3GHz 1.8s 7.5s 32.0s
Orange Pi PC2 1.3GHz 1.6s 7.0s 30.0s
POWER5 1.65GHz -O3 1s 5s 21s
RPi 4 0.78s 3.0s 13.2s
Mediatek G99, Cortex A76 397ms 1,724ms 7,448ms
RPi 5 402ms 1,631ms 6,891ms
ARM Ampere VServer 294ms 1,270ms 5,526ms

Devices written in bold are still in use

unsigned int f[200000];
#include <stdio.h>
#include <time.h>

void compute(unsigned int n, unsigned int *f)
{unsigned int i=1,j,k,l,m=1; f[1]=1; 
 for (j=2; j<=n; j++) 
   {l=0; for (k=m; k<=i; k++) 
      {l=j*f[k]+l; f[k]=l&0x7FFF; l=l>>15;} 
    if (l) {f[++i]=l&0x7FFF; 
        if (l>>15) f[++i]=l>>15;} 
    if (!f[m]) m++;} 

void print_result(unsigned int n,unsigned int *f)
{unsigned int i=*f,j,k,l=0,m=(i-1)%4+15; 
 while(i) {j=0; for (k=0;k<4;k++) {j=(j<<1)+((f[i]>>m)&1);if(!m--){m=14;i--;}} 
 if (!(l&0x3F)) putchar('\n'); putchar(j<10?j+'0':j-10+'A'); l++;} 
 printf("\n\n%d! has %d hex digits\n",n,l);}

int main()    /* int must be >= 4 byte */
{ unsigned int i, n; 
 do {
   printf("calculate n! (n<=120000) n=? ");
   i=  scanf("%d",&n);
 } while (n>120000 );
 clock_t start = clock(); compute(n,f); clock_t end = clock();
printf("time = %ld ms\n", (end-start) / (CLOCKS_PER_SEC / 1000));


C is outdated and not recommended for new projects. 🙂️ Use Rust instead. 🥰️ Below version is optimized.
Safe code as and compile with "rustc -O"

use std::io;
use std::time::{Instant};

fn compute(n: usize, f: &mut [u32]) -> usize {
    let mut i = 1;
    let mut l = 0u64;
    let mut m = 1;
    f[1] = 1;   

    for j in 2..=n {
        for k in m..=i {
            l += j as u64 * f[k] as u64;
            f[k] = (l % 0x1_0000_0000) as u32;
            l >>= 32;
        if l != 0 {
            i += 1;
            f[i] = (l % 0x1_0000_0000) as u32;
            if l >> 32 != 0 {
                i += 1;
                f[i] = (l >> 32) as u32;
        if f[m] == 0 {
            m += 1;

fn main() {
    let mut f = [0u32; 60_000];
    let n = loop {
        println!("calculate n! (n<=120000) n=?");
        let mut n = String::new();

            .read_line(&mut n)
            .expect("Failed to read line");
        let n = match n.trim().parse() {
            Ok(num) => num,
            Err(_) => continue,
        if n <= 120000 { 
            break n;
    let start = Instant::now();
    println!("elemente: {}", compute( n, &mut f));
    let elapsed = start.elapsed();
    println!("n! von {n} in {} ms", elapsed.as_millis());
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License