Turns out Flash is really slow

A place to discuss everything Dragon related that doesn't fall into the other categories.
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Turns out Flash is really slow

Post 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...
Alastair
Posts: 669
Joined: Fri Jul 18, 2008 11:33 pm

Re: Turns out Flash is really slow

Post 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!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Turns out Flash is really slow

Post 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
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Turns out Flash is really slow

Post 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 ;) ).
User avatar
robcfg
Posts: 1529
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Turns out Flash is really slow

Post 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.
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Turns out Flash is really slow

Post 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 :)
admin
Site Admin
Posts: 409
Joined: Thu Jul 17, 2008 10:22 pm

Re: Turns out Flash is really slow

Post by admin »

Wow....really good....
Simon Hardy
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Turns out Flash is really slow

Post 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. :(
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Turns out Flash is really slow

Post 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?
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Turns out Flash is really slow

Post 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.
Post Reply