Page 1 of 3

Turns out Flash is really slow

Posted: Wed Apr 29, 2009 2:58 pm
by sixxie
http://www.6809.org.uk/tmp/test.shtml

And wait a while. About 50 seconds on my Ultra 45 with 2 * 1.6GHz UltraSPARC-IIIi...

Re: Turns out Flash is really slow

Posted: Wed Apr 29, 2009 11:16 pm
by Alastair
Impressive, but it's extremely processor intensive, my laptop's cooling fan is a constant whine meaning the CPU has stepped up to fastest speed and it's still slower than PC Dragon on a 33 MHz 486!

Re: Turns out Flash is really slow

Posted: Thu Apr 30, 2009 12:05 am
by zephyr
Alastair wrote:Impressive, but it's extremely processor intensive, my laptop's cooling fan is a constant whine meaning the CPU has stepped up to fastest speed and it's still slower than PC Dragon on a 33 MHz 486!
Same here. Its a real crippler! :o

Re: Turns out Flash is really slow

Posted: Thu Apr 30, 2009 6:12 am
by sixxie
Yep, it's pretty poor. Not even sure what room there is for performance improvement - it's already pared back quite severely (no HSYNCs for example). Also still slightly buggy, probably due to overflows (no nice uint8_t or uint16_t types in Flash).

Perhaps Java *would* be a better idea. I suppose the language I had to write this in is already quite Java-like in appearance... Mocha manages it, so perhaps Java just has a better bytecode interpreter (or perhaps Mocha cuts more corners than I'd like ;) ).

Re: Turns out Flash is really slow

Posted: Thu Apr 30, 2009 11:16 pm
by robcfg
It takes almost 20 seconds for the text to appear on screen and it is really slow.

Maybe Java could be a nice language to use. I suggest you to look this link. It's an Amstrad CPC emulator fully done in Java and I must say, it runs quite well.

I'm pretty sure that if you contact the author, DevilMarkus, for advice he'll be quite delighted to help you.

Re: Turns out Flash is really slow

Posted: Sat May 02, 2009 3:57 pm
by sixxie
Well cor blimey. Looks like a big part of the slowness was my use of haXe's built-in List class for events. Implementing my own has sped things up significantly!

Still buggy mind, even though I've accounted for the lack of 8 and 16 bit integer types. Wonder what's going on there...

Edit: found the bug :)

Re: Turns out Flash is really slow

Posted: Sun May 03, 2009 8:24 am
by admin
Wow....really good....

Re: Turns out Flash is really slow

Posted: Sun May 03, 2009 10:39 am
by zephyr
Its much faster now, but still very CPU intensive compared to Mocha. Mocha runs very comfortably (~25% CPU) even on my old 1 GiG Pentium III machine. Your Flash Dragon uses 100% CPU time on the same machine, and is very sluggish. :(

Re: Turns out Flash is really slow

Posted: Mon May 04, 2009 1:02 pm
by sixxie
Oh yes, definitely still slow. Suspect it'll never be as fast as a Java implementation (though I don't *know* that), but I do keep finding little bits here and there to shave off.

My main issue at the moment is a persistent bug that I can see no cause for in the code. Lack of good tracing isn't helping - you're supposed to be able to redirect haXe's trace() calls to a Firebug console, but I'm seeing nothing. Anyone been through that?

Re: Turns out Flash is really slow

Posted: Sat May 09, 2009 12:27 pm
by sixxie
Hooray! The bug is fixed :) All my fault: missed some flow control that differed as I did the translation from C to haXe.

I've also added all the other video modes.

Next steps are joystick emulation and snapshot loading, I reckon.

Edit: added snapshot loading, and some snapshots. No joysticks, no sound yet.