It is currently Mon Nov 12, 2018 7:14 pm

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: dumb optimization trick
PostPosted: Sat May 12, 2018 7:15 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2763
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.


Last edited by psycopathicteen on Sat May 12, 2018 9:08 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: Sat May 12, 2018 8:47 am 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3381
Location: Richmond, Virginia
I was thinking of the same thing, actually... :lol: 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.


Top
 Profile  
 
PostPosted: Sat May 12, 2018 9:17 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2763
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: KungFuFurby and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group