# Measurements

> Every number on this site and how it was measured, and how Lane compiles itself.

All figures are from one machine: i7-13700KF (24 threads), Windows 11, shared with other work unless a figure says otherwise. Single runs vary on a shared machine; ranges are given where they were measured.

## How Lane compiles itself

Lane compiles itself in a chain. A bootstrap compiler builds the compiler written in Lane (A); A builds it again (B); B builds it again (C). The test of the whole chain is the fixpoint: A, B and C are the same bytes. Once that holds, the bootstrap compiler is frozen as the seed, and every new feature is written only in Lane.

## Headline figures

### One million lines, built in memory on one thread

Measured, 2026-10-18. **1,105 ms** (the compiler written in Lane, without optimization).

The whole build of a generated program: one million one-line functions, 56 MiB of source, a 128 MiB executable, on one thread, without optimization (-O0). It is the sum of the in-memory build phases (load and parse, collect, compile, layout) and does not include writing the executable to disk. Best of 5 interleaved rounds. Goal, not a result: The project goal is under 1,000 ms.

### The same program on 16 threads

Prototype, 2026-10-14. **225 ms**.

Best of 5 builds of the same one-million-line program (58.8 MB of source, 1,000,010 functions, a 134,892,544-byte executable) with the front end, declaration phases, code generation and image write running on 16 threads with chunks taken from a queue. A scratch prototype, not part of any release. The one-thread build took 1,789 to 1,801 ms in the same session, and the prototype's executable was byte for byte the same at every thread count tried (1 to 32). Taken in a quiet window, with the machine under 20 percent load.

### The compiler builds itself

Measured, 2026-10-15. **18 ms**.

The compiler written in Lane building its own source (628 functions in 29 modules) in memory, best of 3, one thread. It does not include writing the executable to disk or starting the process.

### The compiler reproduces itself byte for byte

Measured, 2026-10-15. **617,984 bytes** (a 617,984-byte executable, built three times in a row with identical output).

The bootstrap compiler builds the Lane compiler (A); A builds it again (B); B builds it again (C). A, B and C are the same 617,984 bytes.

### About 25% fewer tokens for well-tested code

Estimate, 2026-10-14. **about 25%** (fewer tokens).

A test is one line in the function's declaration, about 8 tokens, instead of a separate test function. The sample is one function with a precondition and four tests. It takes 92 tokens in Lane, against 152 to 168 tokens with conventional test frameworks. Tokens were counted with a proxy tokenizer, where each identifier, number, string or symbol counts as one. It assumes tests make up about half of well-tested code. The count covers test code only. It will be replaced by a measurement with a real model tokenizer.

## Front end throughput

| Stage | Threads | Throughput | How measured | Date |
|---|---|---|---|---|
| Lex, compiler written in Lane | 1 | 334 MiB/s | Lane source repeated to 64 MiB, best of 10 | 2026-10-14 |
| Lex and parse, compiler written in Lane | 1 | 161 to 170 MiB/s | A flat tree of arrays with no allocation per node | 2026-10-14 |


## Generated code

Programs compiled by Lane and run, measured 2026-10-14: best wall time of 3 runs with process start included.

| Program | Work | Time |
|---|---|---|
| xorshift | 300 million steps of a 64-bit xorshift generator | 0.436 to 0.438 s |
| collatz | Collatz steps for every start below 2 million | 1.425 to 1.448 s |
| primes | primes below 200,000 by trial division | 1.968 to 1.980 s |
| sieve | primes below 10 million, in a 10 MB buffer from VirtualAlloc | 0.051 to 0.061 s |
| histogram | fill, byte histogram and copy over 64 MiB | 0.310 to 0.311 s |
| records | 30 update passes over one million 20-byte records | 0.105 to 0.106 s |
| interpreter | 100 million instructions of an enum-and-match stack machine | 0.242 to 0.243 s |
| memops | 8 rounds of mem.fill, an unaligned mem.copy and mem.eq over 64 MiB | 0.428 to 0.430 s |
| read_file | os.read_file of a 64 MiB file and a newline count | 0.081 s |


The code generator has no optimizer yet: every value is computed into a register and every variable and temporary lives in a stack slot. Each program returns a checksum that is compared with a reference result before its time is recorded.
