CPCWiki forum

General Category => Programming => Topic started by: ronaldo on 14:04, 08 June 15

Title: SDCC optimization options: experimental analysis
Post by: ronaldo on 14:04, 08 June 15
Starting with the game Platform Climber (http://fremos.cheesetea.com/?wpdmdl=1687), which we published some days ago, I have conducted some experiments to determine the best SDCC compilation modifiers to use. The idea is to get the fastest binary possible, even if it takes 2 hours compiling, as this process is done only once at the end.

I have also taken some time to test the performance of the game, which uses from 25,000 to 45,000 CPU cycles per frame. This is less than 66560 available cycles per frame, which implies that the game goes at 50 FPS, except when scroll happens. On scroll frames, 71,000 to 90,000 cycles are used, which consumes 2 screen frames. As scroll happens once in every 18 frames (aprox), the game runs at ~47FPS.

Here you are all the results (http://fremos.cheesetea.com/wp-content/uploads/2015/06/PClimber_Performance.zip) : DSKs used, screen data outputs and the Openoffice sheet.
You can have a look at this results summary PDF (http://fremos.cheesetea.com/wp-content/uploads/2015/06/PClimber_Performance.pdf).
And you also can check the source coude used (https://github.com/lronaldo/cpctelera/blob/measureplatform/examples/games/platformClimber/src/game.c) to measure times (game function).

I expect to release an article soon explaining the whole process in detail. Meanwhile, the generic recomendation is to use these modifiers for optimized compilation (CPCtelera (http://lronaldo.github.io/cpctelera) example):
make Z80CCFLAGS="--max-allocs-per-node 2000000 --opt-code-speed"

(http://fremos.cheesetea.com/wp-content/uploads/2015/06/pclimber_performance_analysis.png) (http://fremos.cheesetea.com/wp-content/uploads/2015/06/PClimber_Performance.pdf)
Title: Re: SDCC optimization options: experimental analysis
Post by: ronaldo on 16:00, 08 June 15
Sorry: I mistakenly added spanish version of the image previously  :-[ . Now you have the english version
Powered by SMFPacks Menu Editor Mod