GLBasic forum

Main forum => GLBasic - en => Topic started by: MrPlow on 2014-Sep-30

Title: # Cycles Per Instruction
Post by: MrPlow on 2014-Sep-30
A thought came to me whilst looking into some z80 assembly code and I think it would be nice to have for GLB...

Can anyone think or devise a way to calc the number of clock cycles or a benchmark equivalent for each main command type? Would such a thing be useful for us coders? Doesn't need  to be perfect just a guideline, some of you may know a lot of this already.

Perhaps the results may differ totally when run on Android or iOS too though...

Drawrect                       xxx ticks
SpritePoly() (polyvector function)     xxx ticks
Setpixel                         xxx ticks
Getpixel                       xxx ticks
Drawsprite
Rotozoomsprite
Drawanim
createscreen
stretchsprite

etc

I suppose if we avoid the most CPU intensive instructions where possible we could optimise our games?
 



Title: Re: # Cycles Per Instruction
Post by: spacefractal on 2014-Sep-30
impossible to tell really, since this can been very much variered from platform to platforms. Cpu cycles can really only been used on hardware with fixed specs. Android and iOS example dosent have fixed specs at all example.
Title: Re: # Cycles Per Instruction
Post by: MrTAToad on 2014-Sep-30
The best you can get is the function profiler...