Benchmarks

Constructs

Identity · Repeated child replacement

Replace a state-owned child identity repeatedly; equivalent languages may reclaim unreachable children while Range bulk-reclaims its arena at exit

Identity

Repeated child replacement

40m replacements · 30 runs

Replace a state-owned child identity repeatedly; equivalent languages may reclaim unreachable children while Range bulk-reclaims its arena at exit

Range 223.1 ms
Go 294.1 ms
Range malloc 499.3 ms
C 519.7 ms
C++ 575.9 ms
Rust 592.0 ms
Swift 864.7 ms
Test code
C · main.c
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct{int64_t value;}Child;typedef struct{Child *child;}Root;
int main(int argc,char**argv){
    int64_t n=argc>1?atoll(argv[1]):40000000,checksum=0;Root root={malloc(sizeof(Child))};root.child->value=0;
    for(int64_t i=0;i<n;i++){Child*next=malloc(sizeof(*next));next->value=i+1;free(root.child);root.child=next;checksum=(checksum+root.child->value)%1000003;}
    printf("%" PRId64 "\n",checksum);free(root.child);
}
Range · Playground.range
construct Child { let value: Int }
construct Root { state child: Child }
@main {
    let root: Root(child: Child(value: 0))
    state i: Int(0)
    state checksum: Int(0)
    while i < 40000000 {
        root.child: Child(value: i + 1)
        checksum: (checksum + root.child.value) % 1000003
        i: i + 1
    }
    return checksum % 251
}

Measurements

Range passed

LanguageWallCPUPeak memoryRelativeOutput
Range223.1 ms219.1 ms384.6 MB1.00×exit:112
Go294.1 ms304.7 ms10.0 MB1.32×7140
Range malloc499.3 ms493.1 ms614.4 MB2.24×exit:112
C519.7 ms517.0 ms1.6 MB2.33×7140
C++575.9 ms572.1 ms1.6 MB2.58×7140
Rust592.0 ms588.7 ms1.8 MB2.65×7140
Swift864.7 ms861.7 ms2.1 MB3.87×7140

Run procedure

01Generated sourceisolated case directory
02 · optimized builds
  • Ccc · O3
  • C++c++ · O3
  • Rustrustc · opt 3
  • Gogo build
  • Swiftswiftc · Ounchecked
  • RangeLLVM · clang O3
03Rotating run order30 measured runs
04Validate outputexit code + identical result
05Median resultswall · CPU · peak RSS
Commands and notes
Suite
N=<base-iterations> RUNS=<sample-count> npm run benchmarks
C
cc -O3 -mcpu=native main.c -o speed-c
./speed-c <iterations>
Range
RangeCompiler emit-llvm Playground.range Main.ll
clang -O3 -mcpu=native -Wno-override-module Main.ll <runtime-sources> -o speed-range
./speed-range
  • The workload count is specialized per leaf; some leaves intentionally scale it down to keep total work comparable.
  • Wall time includes process execution but excludes source generation and compilation.
  • A result is published only when output remains stable across every measured run.
  • Bun and TypeScript rows are omitted when their local toolchains are unavailable.