measuring idle time during loading?

O

optimistx

How to measure, how much time there would be available for 'extra'
javascript execution during page loading?

How to utilize that time for calculations in js-language? SetTimeout?
If yes, how?

Ideas?

(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')
 
J

JR

How to measure, how much time there would be available for 'extra'
javascript execution during page loading?

How to utilize that time for calculations in js-language? SetTimeout?
If yes, how?

Ideas?

(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')

I think this question is somewhat related to the window.onload
problem, discussed in the thread 'DOM ready, window.onload, etc.':
http://groups.google.com.br/group/c...171c9/94225bbc33f9636f?hl=en#94225bbc33f9636f

Cheers,
JR
 
D

David Mark

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. ;)
 
O

Osmo Saarikumpu

David Mark kirjoitti:
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++)

Actually, it was. Confused the l for a 1 for a second there.
I put it to you that if it is, you are in the wrong business.

I'm sure you are right there :)
 
T

Thomas 'PointedEars' Lahn

Osmo said:
David Mark kirjoitti:

Actually, it was. Confused the l for a 1 for a second there.

That is why I use `len' and the like instead.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top