Day 321 — The gap between the two, decomposed

Wednesday, 23 June 2027 · Week 46 of 52 · Production · Study day · 60 min

Reporting a speedup without decomposing it is how people conclude that C++ is fast when what they measured was that dictionaries are slow, and separating the two is worth an hour.

What you should be able to do tonight

  • Decompose the Python-to-C++ speedup into interpreter overhead and data structure difference.
  • Say what you would do to close most of the gap without leaving Python, and measure it.

Tasks 60 min

35 min Isolate the causes: write a third version in Python using the same data structures as your C++ book, and a fourth using numba on the hot loop. Time all four on the same replay. The four numbers separate the language from the layout, which is the honest decomposition.

25 min Draw the conclusion for your own work: with your latencies from day 304, decide whether any part of your production stack needs C++ at all. The answer is almost certainly no, and being able to say that with measurements behind it is a better interview answer than claiming to be a C++ programmer.

Resources

Deliverable

Four implementations timed on the same replay with the speedup decomposed between language and data structure.

Checkpoint

Explain to a C++ programmer why your Python is slow, and name the two changes that would help most.

Prepare for tomorrow

Ten minutes tonight so Day 322, Thursday, 24 June 2027 starts clean. This is what the evening email sends you.

Write one paragraph on what you can now honestly claim about C++ on a CV.

It should be about reading and reasoning rather than about writing production systems.

Check your timed mixed-set scores.