Closed Thread Icon

Topic awaiting preservation: DHTML Optimisations questions... Pages that link to <a href="https://ozoneasylum.com/backlink?for=22550" title="Pages that link to Topic awaiting preservation: DHTML Optimisations questions..." rel="nofollow" >Topic awaiting preservation: DHTML Optimisations questions...\

 
Author Thread
Shazz
Obsessive-Compulsive (I) Inmate

From: Grenoble/France
Insane since: Jul 2004

posted posted 07-14-2004 14:25

Hi,

I'm quite new to DHTML (not for coding... or try to.. ) and my goal is to redo some kind of oldsk00l thingies on the web.

I started to code a king of game/demo main menu and the more I add things the slower it become 9on my PIII-500 at least)... so I have a few questions (even if I'm trying by myself, experience by crazy people is still interesting) :

1. Is the SetInterval(fn1+fn2+...+fnN, time) call equivalent to
SetInterval(fn1, time); SetInterval(fn2, time);...SetInterval(fnN, time); ?

Roughly speaking does it createn threads ? or one thread calling n functions...


2. To achieve better performance, is it better in oprder to display lotsa sprites (e.g. images) to initialise in HTML a limited set of <DIV> (for example the max number of visible sprites on the screen) and at runtime, with the innerHTML attirbute, add an <IMG src=...> to one on the visible DIV

OR

As I'm doing today, instanciate in HTML as many DIV+IMG (set at -10000px, hidden) as there is sprites image and for animating, get the DIV, set it visible, set its left attribute and then set it hidden when not used...

3. What is the optimal number of threads (setInterval) for IE6 ? Is it dependent of the CPU ?


Ok hope those questions do not sound too dummy...

If sth is interesting in watching my (continously in developement) work : http://www.acerockerz.free.fr/shazz/menu/
(code is not yet optimised in sense precalc, reverse loops, switch versus if... as the global code is not yet clean...

for english spoken people use left and right arrows, space for entereing doors and CTRL to jump


Thanks for your advices...

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-14-2004 15:29

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

Shazz
Obsessive-Compulsive (I) Inmate

From: Grenoble/France
Insane since: Jul 2004

posted posted 07-14-2004 20:11
quote:
InI said:

Well, Shazz, a hearty welcome!



Thanks ! In fact I'm looking silenciously to thios board since a few weeks... especially to the 20 liners compo Great challenges !

quote:
InI said:

Question 1 is hard to answer: it doesn't create threads in IE for example,as
the function calls all are child of the IE process.1)So, "thread" is
not the right word here, especially considering those pseudo threadsare not
safe, and not synchronized: they execute themselves "as they can" depending on
the available cpu.It's more like one thread calling many
functions..I personally find it faster to perform calls to only one
function using setTimeout or setInterval,because both of them tend to
evaluate the expression you pass, and therefore,create large amounts of
unnecessary garbage in memory (instead of a direct call).




Yep, I don't know what they are, threads, light processes,... but for sure not safe (lock lock lock)! But they provided this capability to manage the priority of your code... and that's nice to be able to prioritize the display using many setIntervals to have a smooth anuimation (+1px) instead of huge image shift... So I'll follow you, I'll use 1 fn per setIntervall


quote:
InI said:

2)It is better not only to initialize all the needed variables first,but
also, to get them before execution, eg. to store references to themin an
array before handling the references.



That's still not very clear for me... I see that my game goes slower each time I add a DIV containing a new image... so even if I understand that it is better to instanciate things at runtime to have a faster init and of course use table to store chain reference and avoid lookups... but will my application be faster if I limit the code to use a limited number of DIV tags and play with them modifying the IMG url they contain ??

3. okay

quote:
InI said:

And do a google search for Ray Norrish, an "Amiga to JS" freakI am currently
challenging about some script. Another lunatic, not an active member here sadly.



Yep I took a look to his work... nice !
I started a screen like that http://www.acerockerz.free.fr/shazz/

simply oldschool effects

Shazz from MJJ Prod - Old' 680x0 coder looking in da Web world...

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-15-2004 00:45

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

InI
Maniac (V) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 07-16-2004 02:00

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

« BackwardsOnwards »

Show Forum Drop Down Menu