array sort performance
haXe quicksort
haXe insertionsort
Some performance comparisons on sorting arrays( 100 x random float array with length of 1000 ).
nekoVM
haXe Array.sort: 5.4
Quicksort: 0.3
Insertionsort: 7.5
firefox 3.0.3 js
haXe Array.sort: 6.4
Quicksort: 0.2
Insertionsort: 4.2
flashplayer10
haXe Array.sort: 0.2
Quicksort: 0.1
Insertionsort: 7.5
php 5.2.4
Fatal error: Maximum execution time of 30 seconds exceeded on all tests so i tried with just 10 arrays instead of 100:
haXe Array.sort: 15.3
Quicksort: 4.6
Insertionsort: exceeded
Edit:
Test for flashplay10, with flash.Vector instead of Array:
(i’ve increased the arrays(vectors) to test to 1000 instead of 100 to get a more precise result, so dont compare with the results above )
haxeArray.sort: 1.75
Quicksort: 0.6
Resume:
Use quicksort if you dont need a custom comparison function!
hxmpp : 0.2
![]()
I am very pleasant to announce version 0.2 of our jabber/xmpp library for building xmpp based clients and components. Its written in haxe and cross targets flash9+, js, php and nekoVM.
Haxe seems to be the a superb platform for this kind of thing, since it targets 2 very attractive platforms in the browser (flash, js), but can also create command line based applications like server-components or bots with very little to null difference in code. The only thing that changes from platform to platform is the socket implementation.
I dont have implemented BOSH so far, but you can use the included (invisible) flash9-socket-bridge for connecting to the server with js applications through “regular” sockets. Which has the drawback of the flash player dependency but gives a small (13k), stable connection manager that often feels much more reliable than hakish BOSH connections, at least in firebug;) And…, since disktree.net uses flash in most web based applications anyway, the dependency drawback is kinda irrelevant.
Check the demos in /demos/*.hx for usage.
Hope to see some nice applications! The possiblilities are endless!
[ README ]
[ DOWNLOAD ]
[ API-DOC ]
[ 83.64.208.21/home/tong/git/hxmpp.git ]
Example of usage from plain javascript (without the need of the haxe compiler).
http://paste.disktree.net/34
I am currently working on a programable mutliuser chat bot named ZOD. Visit haxe@conference.jabber.org, with luck, you may experience the impregnation of an artificial intelligence, live and in realtime.
paste.disktree.net
I have upgraded our pasteboard application. (written in haxe->php, based on the fantastic higlighter class from Joakim Ahnfelt-Rønne )
Quite useful, speacially for haXe coders, since there are not many boards supporting the syntax around. Go, use it:
Flash policy nekoVM server written in neko
Flash policy nekoVM server
The changed security settings in flash player >= 9,0,124,0 does not allow you to make a socket connection directly to a server without first obtaining explicit permission from that server in form of a policy-file-request. Follow this article for more information and the flash-policy servers written in perl and python adobe is providing.
I thought it would be nice to have a neko one, so it shall be developed ( using haXe of course ). Thanks to the neko.net.ThreadServer class writing a multi threaded socket server is an easy task.
[flash-policy-server-source.zip]
This could easy be extended with db-logging, .., whatever.
Follow this link for a neko.net.ThreadServer tutorial.
Sperrplan on Superposition
Follow this link for listening to audio tracks produced by myself in between somthing about 2004- 2006. The flash audio player is experimental work providing a basic mediaplayer framework for controlling av media content in flash via an external interface.
From the project description:
WMPE ( short for web media player enviroment ) is a javascript framework written in haXe to provide connectivity to and from mediaplayers emebed in websites.
It provides external interface connections:
* to flash9+ mediaplayers.
* from mediaplayers to controls ( flash or html )
The pros of this approach:
* less loading, no need to embed multiple swf-playback engines.
* centralized audio playback.
* centralized configuration.
* centralized playlist management.
( * sidebar player )
To the title of this blog post: The tracks were produced under the (inactive) music-label sperrplan. Superposition is an upcoming music project from a friend of mine ( for which the player engine gets developed ).
Conways game of life
Here comes the flash from my haXe game of life implementation before the programming paradigm “loose interest after implementing the basics” (one of my best friends ) moves this project into some kind of trash.
The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is the best-known example of a cellular automaton.
holo 0.1.2
i’ve started a new branch using the new flash player 10 3D api and will drop the ugly hacks to have a third dimension completely. So this is the last version for fp9.
Currently i am limited to do some experiments and learning the new api using as3 and the mxmlc compiler cause haxe does not fully support fp10.
( btw, if you have’nt noticed: flash player 10 RC is availbale at labs.adobe.com since 8.11.8 )
[ holo_0.1.2.zip ]
[ skybox_example.swf ]
[ material_example.swf ]
cause this branch is kinda dead, i dont want to get into details about the changes.
.. read the sources and check the demos.
if anyone is interested in doing further develoment. justdoit! and let me know!
Please mind that if you want to have solid 3D in flash but using haXe you are better creating external bindings to one of the existing as3 libs, which works nice for away3D at least.
haXe APE 0.45 #2
I’ve upgraded my APE ( 2D physics engine ) port to work with haXe2.
[ sources.zip ]
haXe 2 released
holo : 0.1
holo is an open source 3D engine written in haXe ( 1.19 ) targeting flash9.
A lot of core stuff is ported from the away3D engine ( which i liked most in terms of design, while studying ).
For now, the runtime target isn’t abstract ( the hx way ), means there is no support for other platforms than flash9 ( soon flash10 ). After studying actionscript3 3d libraries, i thought it would be a great drawback for not using the flash api in respect for designing the display system and the render pipeline and would end up in #if #else hell. Also the performance loss would be nonexcusable. A haXe quicksort of the drawable primitive objects takes about five time than flash.Array.sortOn().
A little performance profit compared to as3 versions should come through the inlining of the math methods and the usage of haxe.FastList ( sadly most collections need an index ).
I have not tested with engine itself right now but:!
Matrix4×3 multiply of two empty matrices:
AS3 ( away3d version ) : 1722 ms
HX : 47 ms
Should have an impact! ( i should doublecheck this, to prove its amzingly true .. later )
Sadly, in flash, rendering takes it all. I’ve only discovered “feelable” performance improvements with render related stuff like backface culling. Maybe this changes with the gain of complexity in the scene.
I do not have model importer rigth now, but have rewritten a AS3 export python script for blender which is included in the sources.
[ BlenderTorus.swf ]
[ BlenderMonkey.swf ]
[ Fluid.swf ]
Current code is written for haXe 1.19.
[ holo.0.1.zip ]
[ git clone git://83.64.208.21/home/tong/git/holo.git ]
[Edit]
The matrix multiplication performance comparison above isn’t valid, because the as3 version was tested in debug player.
After all, 10000000 matrix43 multiplications on release player:
as3 ( away3d ): ~550ms
haXe version: ~460ms
I knowed that the debug player is slower, but thought about a x0.5 rather than x35.
Funware 3 : space invader generator
How its done:
** create invader data:
* calculate nums columns by dividing. ( ( dimension - 1 ) / 2 + 1 )
* create empty 2-dimensional (boolean) array.
* fill arrray with random boolean values.
** draw invader:
* loop the 2 dim array and draw rectangles ( true = color1, false color2 )
* draw the same reflected.
[ invasion.png ]
[ example.swf ]
[ haXe sources ]
holo : first preview
click the image for haXe holo 3D-engine preview.
( red line = ms/frame, blueline = mem used by flash player (overall) )

Next,





