~/talk

Optimising a small real-world C++ application

Talkat ACCU 2019 · 2019-04-10..04-13· [c-and-cpp]
links:none on file
slides:none on file

A configurable C++ converter for COBOL/BCD fixed‑format files becomes usable for disaster‑recovery by profiling and iterative change: uses strace, perf, valgrind/cachegrind and Compiler Explorer to find hotspots, replaces string comparisons with enums, removes runtime division by reading BCD nibbles directly, and switches to memory‑map via Boost iostreams to cut system calls. Measured surprises: mmap drops system time by ~25%, simple loop/formatting fixes give ~4× speedup, a 2‑byte lookup table adds ~10%, and nine incremental versions produce a working, much faster tool.

AI-written summary · about

  1. 0:00Introduction to optimizing
  2. 10:19Performance optimization strategy
  3. 23:56Initial implementation approach
  4. 30:26Using Valgrind cachegrind
  5. 40:50Profiling with perf tools
  6. 45:24Optimizing string handling
  7. 51:59Compiler Explorer insights
  8. 1:00:03Loop and branch optimizations
  9. 1:08:42Memory mapping input file
  10. 1:13:09Two-byte translation table
  11. 1:17:31Template specialization attempt
  12. 1:21:08Compile-time translation table
  13. 1:22:58Final optimizations and summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.