The author optimized a Rust math expression parser to run in under 1 second by eliminating unnecessary allocations, processing bytes directly, parallelizing work, and optimizing file I/O. The final optimization used memory-mapped files, which allowed the operating system to efficiently map the file into process memory, resulting in a time reduction from 43 seconds to 0.98 seconds.