Does having a lot of small methods cause performance issues?

SGDK only sub forum

Moderator: Stef

Post Reply
BroOfTheSun
Interested
Posts: 33
Joined: Fri Dec 12, 2014 2:41 am
Location: USA - Chicago, IL

Does having a lot of small methods cause performance issues?

Post by BroOfTheSun » Tue Mar 17, 2015 11:37 pm

I don't know enough about genesis development to understand if I should be breaking up my methods into small methods. I already break up my methods so as not to copy code in different methods. However, will having a lot of small methods slow down performance?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Mar 18, 2015 5:36 pm

It's directly related to how many calls you do to these methods. If many smalls methods means many calls (let say more than 200 per frame) then yeah it may have an impact on the performance. Compiler should be able to inline small method but I never get GCC to do it correctly :-/

Post Reply