What I want to know is who is paying for #2?  Very rarely do I ever get time 
to comment anything, and even if I did, the code I commented changes the 
next day, rendering the whole endeavor fruitless.

...not to mention most service work is always a custom job/rewrite anyway.

----- Original Message ----- 
From: "Paul BH" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Wednesday, December 21, 2005 4:49 PM
Subject: Re: [Flashcoders] Faster code?


I think these are all great, but if I can be the voice of caution for
a moment...

remember that when you write code, it is for 2 interpreters:

1) the Actionscript VM
2) the person who has to go back and change stuff at a later date,
which may or may not be you...

Its often very easy to forget number 2 - so, while writing doing
things like avoiding function calls may be faster for 1) it can end up
making things a lot slower for 2)

Also, when you go through your code & optimise it, make sure you are
efficient with your efforts - you will probably find you can nail down
key performance spikes to just a few functions / algorithms... be
careful not to optimise to death, and try and measure your gains at
each step

I'm not saying code shouldnt be optimised at the expense of (human)
readability, just that sometimes it gets a little overdone...

ta

PBH

On 12/21/05, Steven Sacks <[EMAIL PROTECTED]> wrote:
> > the fastest loop through an array is:
> >   var len = myArray.length;
> >   while( len-- ) {
> >     ...
> >   }
> > yes, it's faster then for..in.
>
> Not always. Sometimes, this loop is faster than a while (i--)
>
> for (var i = items.length; --i - (-1); ) {
>        ...
> }
>
> It's ugly, yes, but it is faster than while (i--) depending on how many
> items you're iterating through.  Run some tests if you don't believe me. 
> :)
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to