Update: linebreaks slow down the compiler?
I’m a tard. Sorry. Don’t stay up til 4 am :)
it’s the debug player.
![]() |
![]() |
I’m a tard. Sorry. Don’t stay up til 4 am :)
it’s the debug player.
UPDATE: (dont’ read this, it’s the debug player’s fault)
A reminder to not post anything at 4 in the morning.
I was just screwing around testing hash lookup speeds, and ran into something very very curious. I originally though that putting multiple variable assignments onto one line would make things faster. But when I went deeper into it, it looks like *JUST* removing items and putting them onto one line makes things faster. Take the following code blocks, one with line breaks removed, one without.
With line breaks: 808 milliseconds for a 1m loop
Without line breaks: 641 milliseconds for a 1m loop
You can get your code to run 20% faster just by removing line breaks? This is uber-news to me.
Try it out yourself … it’ quite baffling.
private function test2():void {
var start:int = getTimer();
for (var count:int = 0; count < 1000000; count++) {
var obj:Object = {};
obj.a = 1;
obj.b = 2;
}
// 808 ms
trace(getTimer() - start);
}
private function test():void {
var start:int = getTimer();
// everything on one line
for (var count:int = 0; count < 1000000; count++) { var obj:Object = {}; obj.a = 1; obj.b = 2; }
// 641 ms
trace(getTimer() - start);
}
If you haven’t seen the demo, look at http://www.onyx-vj.com/demo
First, download the AIR runtime at http://get.adobe.com/air.
Then download the AIR installer at:
http://www.onyx-vj.com/download/Onyx-VJ.air
What’s new?
File System access (saving reading/writing files)
MIDI! (next beta will be update for the mac version)
Automatic thumbnailing
For updates and more info, please join the google group at http://groups.google.com/group/onyxvj