Page 1 of 1
dumb optimization trick
Posted: Sat May 12, 2018 7:15 am
by psycopathicteen
I was looking at ways to save memory for object slots and I got it down to 84 bytes. What I found special about this number is that it's slightly less than 256/3. If I page align every 3rd object slot, direct page instruction will be 1 cycle faster for every 3rd object.
Re: dumb optimization trick
Posted: Sat May 12, 2018 8:47 am
by Drew Sebastino
I was thinking of the same thing, actually...

Another little trick is that I like to have it to where the end of a loop is when an index register is 0, so I don't need a cmp instruction.
Re: dumb optimization trick
Posted: Sat May 12, 2018 9:17 am
by psycopathicteen
Now I need to find a way to always have objects spawn into the page-aligned slots first so they have a higher chance of being in a page-aligned slot. Using a linked-list object slot system makes this more difficult.
I could probably take this one step further and have slow slot objects move into fast slots when a free fast slot becomes available.