Constructs
Identity · Shared binding mutation
Mutate one array cell through a stable binding path and observe every update through its original owner pathIdentity
Shared binding mutation
Mutate one array cell through a stable binding path and observe every update through its original owner path
C 123.0 msabsolute best
Rust 123.1 ms
C++ 123.8 ms
Go 124.3 ms
Swift 124.8 ms
Range 133.8 ms
Test code
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct{int64_t value;}Counter;typedef struct{int64_t *value;}View;
int main(int argc,char**argv){
int64_t n=argc>1?atoll(argv[1]):40000000,checksum=0;
Counter *counter=malloc(sizeof(*counter));counter->value=0;
View *view=malloc(sizeof(*view));view->value=&counter->value;
for(int64_t i=0;i<n;i++){counter->value=i+1;checksum=(checksum+*view->value)%1000003;}
printf("%" PRId64 "\n",checksum);
}construct View { binding values: [Int] }
@main {
state values: [0]
let view: View(values: $values)
state i: Int(0)
state checksum: Int(0)
while i < 40000000 {
view.values[0]: i + 1
checksum: (checksum + values[0]) % 1000003
i: i + 1
}
return checksum % 251
}Measurements
Range passed
| Language | Wall | CPU | Peak memory | Relative | Output |
|---|---|---|---|---|---|
| C | 123.0 ms | 120.6 ms | 1.6 MB | 1.00× | 7140 |
| Rust | 123.1 ms | 120.9 ms | 1.8 MB | 1.00× | 7140 |
| C++ | 123.8 ms | 121.4 ms | 1.6 MB | 1.01× | 7140 |
| Go | 124.3 ms | 122.2 ms | 4.0 MB | 1.01× | 7140 |
| Swift | 124.8 ms | 121.9 ms | 2.0 MB | 1.01× | 7140 |
| Range | 133.8 ms | 131.6 ms | 1.7 MB | 1.09× | exit:112 |
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
N=<base-iterations> RUNS=<sample-count> npm run benchmarkscc -O3 -mcpu=native main.c -o speed-c
./speed-c <iterations>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.