From:  "VK" <>
Date:  22 Sep 2006 01:44:19 Hong Kong Time

Re: Weird behavoir while using function aliases


"Alias is more effective then explicit method call" is some kind of
urban legend to me appealing to one of the most strong mythologems of
programming: "shorter text === quicker program"; "alias()" is much
shorter than "f.ff.fff.ffff()", thusly it just has to be more
With such linear interpretation it would be also obvious to expect that
f() - f.ff.fff.ffff() - f.ff.fff.ffff.f.ff.fff.ffff() - ...  have to
show twice bigger time difference between each pair from left to right.

In fact the maximum possible performance is very rarely the primary
target in programming. There are much more important factors:
stability, easiness of maintenance (including readability), easiness to
upgrade and to incorporate into other blocks of code. Speed is really
the last in the list. And with speed itself timed loops is the worst
tool one can get: because as I said you are really studying run-time
optimization mechanics of a particular engine, and only after (and if
lucky) your own question.

There is a simple and effective alternative to it: the code is quick
enough if it's quick enough for yourself. That leads to: never program
on a "best configuration of the year": always use an average-good
configuration of the *last* year (or even few years old). If say you
are satisfied with results on 900Mz/128Mb, your customers will be most
definitely satisfied on 3Gz/1Gb.

That doesn't eliminate a normal human curiosity: "how is this stuff
really ticking inside?" It's ticking rather interestingly and
differently for different script engines. In application to Microsoft
JScript one can study IDispatch interface (search MSDN for "IDispatch",
"IDispatch::Invoke", "IDispatch dispid").

P.S. See
 What do
one thinks is being studied here? alias or run-time optimization and
threads management in different UA's? If one thinks the first, then
play with setTimeout delay, try runs with different handycaps. Choose
the "J-horse" you bet for sure by three runs results and tell me when
ready :-)

P.P.S. As it is build on frames, it can be boring to copy page by page
(if one wants).

contains full frameset.