I have less experience optimizing on Linux, but learn about profilers there (e.g.
http://euccas.github.io/blog/20170827/cpu-profiling-tools-on... ) and remember that Amdahl’s law suggests focusing on one bottleneck at a time. But sometimes fixing a bottleneck means not just improving code in the bottleneck, but also how and when other code gets to the bottleneck.