PenguinV: Wrapping Up

So I tried optimizing the median function one last time by playing with the 4 level loop. From what I understood in class, reading memory along its row and iterating between rows is more efficient than reading along columns and iterating through columns. So just to be sure I slipped the third inner loop with the fourth inner loop to see how that improves performance. Well it didn’t really change performance; the test still showed numbers within the variance of the base case. To be honest, I’m pretty sure it was already reading by the row anyways. With no other ideas, I have decided to not push my changes upstream.

Although my results indicated that changing the compiler optimization option to O3 would improve the overall performance of the functions, I would only be improving the times for penguinV’s performance tests. As stated before, the libraries are not meant to be precompiled and used but included as a header file into other’s projects. This means that the compiler optimizations chosen are dependent on the recipient’s project settings. The most that changing the performance test to O3 can do is show that performance is better at O3. However, the absolute decrease in runtime is in the milliseconds and these functions are not meant to be called continuously. It is also safer for developers to see the performance at O2, which is a more stable optimization setting that their own program probably uses. Therefore, since my changes do not touch penguinV’s library primary functionalities and O3 is a less common use case than O2, I will not be making a PR with the changes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website at WordPress.com
Get started
%d bloggers like this: