Are there any good ways or resources to optimize my game?

I have a program intended to use on the raspberry pi that uses 2500 cubes and moves them as a function of time (though I would prefer more blocks if possible) and uses 4 viewports with 4 cameras (it does not do anything else). Obviously it is quite a hefty program for a raspberry pi and I was wondering if there are any specific things I can do or resources I can use to better optimize my program.

Are you using a StaticModelGroup for the cubes?