Profiling and Optomisations

Over the last few weeks i’ve been looking into how fast SpeccyDS currently runs and how it can be optomised to handle some of the new features.  Therefore, I added a simple speed meter that displays the percentage speed when compared to a real Spectrum.  The results were quite suprising…

When idling in Spectrum BASIC, SpeccyDS ran at 134% of a real Spectrum.  When under load (I used the menu screen of Cobra), the speed fell to 116%.  Far to low for my liking.

I knew that my display routines were not the best in the world.  I had put them together with a ’just get it working’ attitude and I knew that there were savings to be had.  With this in mind, I tried disabling them so I could just measure the speed of the CPU core.  The speed jumped up to a massive 495%/312% (BASIC/Cobra)!

Obviously there was something seriously wrong in the display routines.  After a lot of swaping and re-coding, i’ve managed to get the speed up to a much more impressive 210%/168%.  The change in the code will also let me use the DS hardware to scale the Spectrum display to allow borders to be shown.  I’m not sure how practical this will be, but it will be nice to have the option.

Unfortunatly, this speed boost seems to have broken my sound code.  It doesn’t look like the CPU syncronisation enjoys going over the 200% speed barrier.  It is a bit odd to have problems because SpeccyDS is running too fast :)

5 Comments so far

  1. em22 on 16 January 2007

    This all sounds very interesting :) cant wait for th enext release.

  2. Drood on 18 January 2007

    Still wish I could find a quick way to edit roms to work. I’ve hunted and cannot find a single decent batch convertor for Z80 format files.

  3. kmet on 19 January 2007

    Add support for R4, please!

  4. Kasimir2007 on 19 January 2007

    Yes support for R4, I have a M4 DS simply.

    Or …… put the Support DLDI for next version.

    I hope to see this soon.

    Thanks..

  5. Uto on 22 January 2007

    @Drood, try spconv

    http://www.worldofspectrum.org/utilities.html

    And convert from Z80 to SNA and then back to Z80, maybe SpecyDS supports SNA as well, I’m not sure.

Leave a reply