The Curious Engineer

All blogs / Performance / optimization

Johnny's Software Lab

johnnysswlab.com

Welcome to Johnny’s Software Lab, a blog for all interested in fast software written in C and C++. Your program doesn’t run fast enough? You need someone to talk to about your software’s performance? You or your team want to learn to write faster software? Whatever it is, we can help you. Check out

Performance / optimizationC++CPU / microarchitecture

Posts
83 from 9 May 2020 to 26 Feb 2026
Posting
now and then (3 in the last year)
Kind
personal blog
Feed
https://johnnysswlab.com/feed/

2026 2

  1. Exposing More Parallelism Is the Hidden Reason Why Some Vectorized Loops Are Faster – Not Vectorization per se
  2. Floating-Point Error Handling in C++: What Actually Works

2025 6

  1. Deep Dive in Java vs C++ Performance
  2. 9 Things Every Fresh Graduate Should Know About Software Performance
  3. The messy reality of SIMD (vector) functions
  4. An optimizing compiler doesn’t help much with long instruction dependencies
  5. Growing Buffers to Avoid Copying Data
  6. Performance Debugging with llvm-mca: Simulating the CPU!

2024 8

  1. FIYA – Flamegraphs in Your App
  2. Memory Subsystem Optimizations – The Remaining Topics
  3. Speeding Up Convergence Loops. Or, on Vectorization and Precision Control
  4. Latency-Sensitive Application and the Memory Subsystem Part 2: Memory Management Mechanisms
  5. Latency-Sensitive Applications and the Memory Subsystem: Keeping the Data in the Cache
  6. The pros and cons of explicit software prefetching
  7. A story of a very large loop with a long instruction dependency chain
  8. On Avoiding Register Spills in Vectorized Code with Many Constants

2023 12

  1. Unexpected Ways Memory Subsystem Interacts with Branch Prediction
  2. Multithreading and the Memory Subsystem
  3. Speeding Up Translation of Virtual To Physical Memory Addresses: TLB and Huge Pages
  4. Faster hash maps, binary trees etc. through data layout modification
  5. Performance Through Memory Layout
  6. Measuring Memory Subsystem Performance
  7. Hiding Memory Latency With In-Order CPU Cores OR How Compilers Optimize Your Code
  8. Software Performance and Class Layout
  9. Horrible Code, Clean Performance
  10. Decreasing the Number of Memory Accesses: The Compiler’s Secret Life 2/2
  11. Decreasing the Number of Memory Accesses 1/2
  12. Frugal Programming: Saving Memory Subsystem Bandwidth

2022 12

  1. Loop Optimizations: interpreting the compiler optimization report
  2. For Software Performance, the Way Data is Accessed Matters!
  3. What is faster: vec.emplace_back(x) or vec[x] ?
  4. When an instruction depends on the previous instruction depends on the previous instructions… : long instruction dependency chains and performance
  5. The memory subsystem from the viewpoint of software: how memory subsystem affects software performance 2/3
  6. The memory subsystem from the viewpoint of software: how memory subsystem affects software performance 1/3
  7. Instruction-level parallelism in practice: speeding up memory-bound programs with low ILP
  8. Memory consumption, dataset size and performance: how does it all relate?
  9. Crash course introduction to parallelism: Multithreading
  10. Vectorization, dependencies and outer loop vectorization: if you can’t beat them, join them
  11. Making your program run faster: the key concepts of software performance
  12. Why is quicksort faster than heapsort? And how to make them faster?

2021 21

  1. When vectorization hits the memory wall: investigating the AVX2 memory gather instruction
  2. What are premature optimizations?
  3. Why do programs get slower with time?
  4. Loop Optimizations: taking matters into your hands
  5. Loop Optimizations: how does the compiler do it?
  6. The quest for the fastest linked list
  7. Performance Tuning Contest: July 2021 edition
  8. Debugging performance issues in kernel space: minor fault and major faults
  9. Hardware performance counters the easy way: quickstart likwid-perfctr
  10. Debugging performance issues in kernel space: system calls
  11. Memory Access Pattern and Performance: the Example of Matrix Multiplication
  12. “Premature optimization is the root of all evil”. Or is it?
  13. Flexibility and Performance
  14. Speedscope: visualize what your program is doing and where it is spending time
  15. Speeding up an Image Processing Algorithm
  16. The true price of virtual functions in C++
  17. 2-minute read: Class Size, Member Layout and Speed
  18. Performance Tuning Contest: February 2021 edition
  19. Crash course introduction to parallelism: SIMD Parallelism
  20. 2-minute read: How is Big O notation relevant on modern systems?
  21. Crash course introduction to parallelism: the algorithms

2020 22

  1. Making your program run faster in a multithreaded environment
  2. 2-minute read: the Magic Touch of Parallel Algorithms
  3. 2-minute read: What is faster, std::endl or ‘\n’?
  4. Use explicit data prefetching to faster process your data structure
  5. Multitime: a small utility to measure your program’s runtime
  6. Excessive copying in C++ and your program’s speed
  7. Make your programs run faster: avoid expensive instructions
  8. Tune your program’s speed with profile guided optimizations
  9. Process polymorphic classes in lightning speed
  10. RR: The magic of record and replay debugging
  11. The price of dynamic memory: Memory Access
  12. The price of dynamic memory: Allocation
  13. Lessons in debugging: observe how programs interact with the Linux kernel with STRACE
  14. How branches influence the performance of your code and what can you do about it?
  15. CPU Dispatching: Make your code both portable and fast
  16. GDB: A quick guide to make your debugging easier
  17. Make your programs run faster: avoid function calls
  18. FlameGraphs: Understand where your program is spending time
  19. MOSH – a simple SSH replacement that works when network conditions are bad
  20. Link Time Optimizations: New Way to Do Compiler Optimizations
  21. Make your programs run faster by better using the data cache
  22. A story about error recovery a.k.a those boring recurring bugs and what to do about them