2 comments on “Amateur Optimization Hour

  1. > Therefore, one of my first optimizations was to remove all the stack variables from DrawMapSection, and turn them into… global variables.

    The compiler option –static-locals does the very same for the very same reason without any source code change. The compiler docu is you friend 😉

    • That’s a good point and definitely useful. In this case, making them globals meant I could access them from inside several different functions instead of passing things on the stack. Also I was able to move the whole struct into zero page later on, which was a nice bonus.

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