How to measure, how much time there would be available for 'extra'
javascript execution during page loading?
That doesn't make sense. Can you rephrase the question?
How to utilize that time for calculations in js-language? SetTimeout?
If yes, how?
Ideas?
Same.
(the question arose from the magic word 'efficiency': IF there is
plenty of idle time during loading, why should one make less
clear, difficult-to-read programs to have them more 'efficient')
You seem very confused. There is no argument that says to write the
most inefficient code possible (e.g. using jQuery) and neither is
there one that says you should write everything to execute as
efficiently as possible. It sounds like you are looking for an excuse
to do something, but I don't know what that something is.
What does the application do? What sort of agents will it need to run
on? And are you proficient at code optimization (your name would seem
to indicate that you are?) The first three rules of browser scripting
are: context, context, context.
And, as an aside, there's nothing more difficult-to-read (or maintain
or debug) than jQuery "sentences". That much should be obvious. I
know that those raised by video games might think otherwise, at least
those with no experience in reading programs of any kind. Memorizing
patterns and mapping land mines is more video game than programming
strategy.
But - for example - is this:-
for (var i = 0; i < a.length; i++)
....really harder to read than:-
for (var i = 0, l = a.length; i < l; i++)
I put it to you that if it is, you are in the wrong business. Is the
optimization worth it? Depends on the context.
