Forum Moderators: open

Message Too Old, No Replies

overclock the site?

Want to make my script run faster(in IE)

         

merijnvw

10:32 am on Jan 23, 2010 (gmt 0)

10+ Year Member



I'm working on a web-based MS Paint style drawing program in JavaScript, later I'll let it work on the server so that on multiple computers you can work on the same drawing in a session(like a whiteboard)
For the drawing part I now only have a pencil & brush tool yet. It constantly checks the mouse coordinations and draws a line from the old coordinations to the new ones. It's working fine in Firefox, but in IE the script runs too slow. And because it's slow, the scripts catches less mouse coordinations, and the line drawn is more angular whereas in FF it's smooth.
So my question is: Should I try to make my script shorter in order to make it run faster in IE, or is there also another option? Like temporarily overclocking IE when the visitor watches the page? Maybe a weird thought...
thanks in advance

Frank_Rizzo

2:09 pm on Jan 23, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Pack the javascript. Use something like

Dean Edwards Packer

This will make the code smaller to load but you will need to check the run time advantage.

If using Firefox install Firebug and Yslow.

Do you have control over the end user PC? If yes then make them use FF.

Run a windows optimizer app which tunes IE as well as network connections.

Remove the bloat such as toolbars which may be bolted onto IE.

astupidname

10:18 pm on Jan 23, 2010 (gmt 0)

10+ Year Member



Should I try to make my script shorter

Without seeing the script, it's hard to say whether or not there are any significant performance bottlenecks within it. That said, unless there are significant bottlenecks, the actual length of the script will have little to no noticeable effect. Minification will make no difference in run-time performance, only quicker download.

Like temporarily overclocking IE

Well, I've heard of overclocking in regards to processors, but never heard of such a thing with a web browser and don't believe that's possible from javascript.

I'm working on a web-based MS Paint style drawing program in JavaScript,

It constantly checks the mouse coordinations and draws a line from the old coordinations to the new ones. It's working fine in Firefox, but in IE the script runs too slow. And because it's slow, the scripts catches less mouse coordinations, and the line drawn is more angular whereas in FF it's smooth.

Javascript application running on a web browser may be simply the wrong environment for heavy animations such as this, I'm afraid. As a person who has done extensive benchmark testing of animation timing differences between IE and FF and others, I can say that IE simply will not keep up to run as fast as one may want. As a general rule of thumb, it's best not run at less than 25ms per cycle when accessing DOM and can be even longer in some situations. In fact, attempting to run faster can actually slow it down even more and cause longer real-time run cycles. That said, believe it or not there are situations where it outperforms FF, but generally not usually.
I believe Flash/Actionscript 3 would be a much better choice for such heavy animations.

vol7ron

3:11 pm on Jan 28, 2010 (gmt 0)

10+ Year Member



I hope you were not being literal. It is not possible to "overclock" a website. Why? Because clock speed (or clock cycles) in which hardware goes through to execute an instruction; this speed is measured in Hertz (eg MHz, GHz). Overclocking is just taking hardware (as shipped) and raising the speed beyond specifications. Websites don't have hardware, they are software.

What you're more-than-likely looking for is a way to optimize/over-optimize your code. For that, there are many different ways, but as may have been stated, we'd need to see the actual JavaScript for thatt.