Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-16-2009, 03:59 PM   #1
danilo2
Registered User
 
Join Date: Mar 2009
Posts: 4
Default AS3 and Haxe

Hi, I'm currently building a big website application in which I'll be using a lot of bitmap blitting, math operations and so on. So EVERY optimalisation will help my app be better.
Today I was reading a lot about haxe - some people says that it is faster, some that slower than AS3 hmmm But I couldn't find actuall topic (this is almost all topics "as3 vs haxe" were written in 2007) So I have question for you - Is haxe really faster than Actionscript3? (Of course I will write in Haxe in "haxeactionscript" not cor another language).

If it is faster, than, please write me what exactly can i get better in it
Thank You very much and I'm waiting for Your's reply
danilo2 is offline   Reply With Quote
Old 03-16-2009, 04:49 PM   #2
JLM
Are you adding something?
 
Join Date: Oct 2002
Location: Oxfordshire
Posts: 397
Default

Haxe supports some Alchemy opto codes that as3 does not currently support
http://www.ncannasse.fr/blog/virtual_memory_api
I am not sure that 3D has found much speed increase through using them due to how they have to be used.

FastList's are faster than arrays. And stricter typing structures allow more speed.

XML parsing seems to be easier to do fast in AS3?

I really don't think though there is a huge difference between haXe and AS3 most of the time as its all ABC it probably as much down to the coder or libraries available, the real differences are when you get neko to process it backend, and don't have to re-code the classes, I mean if you change player or browser it will as lightly or not change the speed more.

With all things you need to do real experiments as theory is not the same as practice.

But if you have some real algorithms post them somebody might be able to give qualitative advice and I would not be surprised if they could be made to run faster in haxe.
__________________
Artist and Flasher.
JLM is offline   Reply With Quote
Old 03-16-2009, 09:14 PM   #3
danilo2
Registered User
 
Join Date: Mar 2009
Posts: 4
Default

Thanks for your reply! I hope, that (in most cases) when I will be programming in Haxe it would be faster and not slower than in as3 I'll make some tests and I'll publish the results maybe in a week or so.

Ok so I've got another question - when it comes to blitting, does anyone have idea if I could use this "super abilites" of haxe to draw (or copy) pixels between bitmaps?

edit: And additional - anybody knows where can I get Haxe manual?On this site: http://haxe.org/api I think the manual is old (most of examples are connected with AS2 (fe. movieClip's properties _x and _y, and in real compile the x and y properties are working). Additional there are not all classes, fe. flash.memory
danilo2 is offline   Reply With Quote
Old 03-17-2009, 09:35 AM   #4
JLM
Are you adding something?
 
Join Date: Oct 2002
Location: Oxfordshire
Posts: 397
Default

There is a lot of info on the site, you just need to look round.. for instance I created some simple flash9 examples
http://www.haxe.org/byexample

But there are some really good examples that Nicolas has posted and there is lots on his blog, I will ask the list about a blog link list, and if I get a list together I will post it back here.

The community is important have a look through lib.haxe.org its where you can see different approaches to code for example
MassLoader, SWFAddress, sandy, physaxe, feffects TweenerHX, facebridgex etc...

the haxe book is kind of a must have covering basic language use it might be online now but a small investment to save you time.
__________________
Artist and Flasher.
JLM is offline   Reply With Quote
Old 03-17-2009, 10:05 AM   #5
JLM
Are you adding something?
 
Join Date: Oct 2002
Location: Oxfordshire
Posts: 397
Default

sorry without trying the virtual_memory_api I can't answer your question on blitting copying pixels but would imagine it could be used in connection.
__________________
Artist and Flasher.
JLM is offline   Reply With Quote
Old 03-17-2009, 10:14 AM   #6
JLM
Are you adding something?
 
Join Date: Oct 2002
Location: Oxfordshire
Posts: 397
Default

I think you can download ChxDoc from http://www.codeblackbox.com/ and it provides documentation for your projects and also haxe eg...
http://www.codeblackbox.com/chxdoc_s...ser/index.html
http://www.codeblackbox.com/chxdoc_s...per/index.html
__________________
Artist and Flasher.
JLM is offline   Reply With Quote
Old 03-17-2009, 11:32 PM   #7
danilo2
Registered User
 
Join Date: Mar 2009
Posts: 4
Default

JLM thank you really very much!
I see, that haxe language is really similar to AS3 ( but haxe doesnt have WITH keyword and INTERNAL :P )

So here goes my last question:
Does somebody have an idea how to connect virtual_memory_api with bitmaps? (I know only one method to convert byteArray to Bitmap -> throught Loader.loadBytes -> convert to bitmapData, but I hope thereisafaster one )
danilo2 is offline   Reply With Quote
Old 03-19-2009, 09:29 PM   #8
danilo2
Registered User
 
Join Date: Mar 2009
Posts: 4
Default

So does anybody knew what to do to speed up working with bitmap data using haxe?
I really please about answer if it is possible
Thank You verymuch and I'm waiting for Your's reply
danilo2 is offline   Reply With Quote
Old 04-18-2009, 01:31 PM   #9
Amn
beyond coding concepts
 
Amn's Avatar
 
Join Date: May 2002
Posts: 227
Default

Nicolas himself (the author of haXe) had found out that tweaking haXe and using virtual memory api (opcodes not used by Flash/Flex yet) he had mocked up an inverse square root function which was %686 percent faster than whatever he could produce with AS3 and Flash/Flex. I.e. more than 6 times faster.

There are also inline functions which can speed up things really well, I guess depending on the context up to 3 times too, who knows. There is, again, the virtual memory API, which is another way to do bitmaps among other things, but about 1.5 times faster than the Bitmap classes themselves.

There are more things, and you can read about them on haXe's website.

If you do 3d, you will probably on average be twice as fast as whatever folks with AS3 can do these days, because of all the small things you can optimize in haXe that you cannot do anything about with AS3 and the compilers Adobe has.

And, haXe has been faster than the rest for a good half year now. But the documentation is still subpar. And it hurts bad...
Amn is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone else think haXe is kind of pointless? mattkenefick haXe 73 11-16-2009 09:14 PM
AS3 Coding Workflows - Textmaters & FD3ers madgett General Chat 0 11-02-2008 01:00 AM
Thanks + links JLM haXe 2 10-20-2008 01:10 AM
haXe Get Flash9 ncannasse ActionScript 3.0 4 08-18-2006 12:05 PM


All times are GMT. The time now is 11:16 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.