Components

Functions

The initial implementation (basic.py)

We started with a straightforward single-threaded Python script:

Performance:

~10.5 seconds on 10 million lines.

This was expected: most time spent was in


Step 1: Memory-mapped I/O (prime.py)

We tackled the biggest bottleneck first — file reading.

What we changed