Expanded Loops | Ugly and Efficient! 馃懝 | Part 2

Moving forward with optimizing and uglifying for loops, the next technique I want to write about here is loop tiling or loop blocking. If you鈥檙e coding a program that heavily relies on for loops, this method will greatly help improve the performance of the program. As the name suggests, this technique divides large loops into smaller tiles or blocks to better fit into the processor cache. The problem with large loops and heavy code blocks is that they take up much of our precious CPU鈥檚 cache space, which is crucial for processing tasks....

March 8, 2023 路 5 min 路 854 words 路 Me

Expanded Loops | Ugly and Efficient! 馃懞 | Part 1

So, a few weeks ago, I started working on a research project that involved writing a chemical reaction simulator with tons of loops and calculations. The complexity of the code grew exponentially as the problem鈥檚 variables and dimensions increased. I tried optimizing the code itself, yet I wasn鈥檛 satisfied enough. So as any intelligent engineer would do, I decided to dive deep and discover what exactly happens to the code we write in a high-level language....

February 24, 2023 路 5 min 路 921 words 路 Me