Author Topic: # Cycles Per Instruction  (Read 1641 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1784
    • View Profile
# Cycles Per Instruction
« 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


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

Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3956
    • View Profile
    • Space Fractal
Re: # Cycles Per Instruction
« Reply #1 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.
« Last Edit: 2014-Sep-30 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.


  • Guest
Re: # Cycles Per Instruction
« Reply #2 on: 2014-Sep-30 »
The best you can get is the function profiler...