HighDots Forums  

Re: Perf prob with IE

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Perf prob with IE in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Evertjan.
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 04:23 AM






Raj wrote on 06 dec 2004 in comp.lang.javascript:

Quote:
We have a table with about 2400 cells. Our requirement is to highlight
the cells in the table whose data has changed, every 5 seconds. Our
script behaves relatively ok in Firefox, but the performance in IE
really bad. Have attached a simple html which simulates the prob. Any
inputs on how to improve the perf in IE are greatly appreciated.
<td>s do not change by themselves,
but if you mean by "changed" <input>s changed by the user,
try for IE:

input { background-color:expression(value!=defaultValue?"cyan":"");}

I don't know the performance loss of the expression() syntax with such an
silly large number of <input>s


Reply With Quote
  #2  
Old   
qweries@gmail.com
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 04:41 AM






Hi Evertjan:

Every 5 secs fresh data is downloaded from the server. The downloaded
data is compared against the data currently being displayed in the
table. If any of the cells have changed, the javascript updates the
value of the cell and changes the cell color based on whether the
change is positive or negative from the previous value.


Reply With Quote
  #3  
Old   
Rob B
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 04:54 AM





Only 2400? :0

http://www.peachpit.com/articles/article.asp?p=31567

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #4  
Old   
Rob B
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 04:59 AM





Just a thought: why not have the server determine this, and return a
(DOM-oriented) JS which does the highlighting?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply With Quote
  #5  
Old   
qweries@gmail.com
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 07:30 AM



Hello Rob,

Doing the checks on the server side would be scalability issue. It
would be better if we could utilize the client CPUs for rendering.


Reply With Quote
  #6  
Old   
Evertjan.
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 09:26 AM



wrote on 06 dec 2004 in comp.lang.javascript:

Quote:
Every 5 secs fresh data is downloaded from the server. The downloaded
data is compared against the data currently being displayed in the
table. If any of the cells have changed, the javascript updates the
value of the cell and changes the cell color based on whether the
change is positive or negative from the previous value.

This is not email. Your answer is read by many, so PLEASE quote a relevant
part of the original. Follow usenet netiquette.

==================

Downloaded to a HTML table, how, why?

Then you loose the original table cell content, I suppose.

I suggest you do such comparing on the server, not on the client browser.

Evertjan.



Reply With Quote
  #7  
Old   
qweries@gmail.com
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 09:44 PM



Quote:
Every 5 secs fresh data is downloaded from the server. The
downloaded
data is compared against the data currently being displayed in the
table. If any of the cells have changed, the javascript updates the
value of the cell and changes the cell color based on whether the
change is positive or negative from the previous value.

Quote:
This is not email. Your answer is read by many, so PLEASE quote a
relevant
part of the original. Follow usenet netiquette.
I am using http://groups.google.com which has pretty much gmail like
threaded view, so didnt realize the problems other face. Will
copy+paste the relevant parts ... sorry and thanks.

Quote:
Downloaded to a HTML table, how, why?
Then you loose the original table cell content, I suppose.
I suggest you do such comparing on the server, not on the client
browser.

Ok ... let me try to elaborate on the problem. The application shows
the prices of stocks being traded in a web page. When a user logs in to
the application, they can select the stocks they are interested in.
They are then taken to a page which shows the price [and other details]
of the stocks in the form of a table. Every 5 secs there is a script
which downloads the new price list [in csv format] and updates the
cells which have changed. The background colour of the cell is changed
based on whether the new value of the cell is more/less than the
current value.

We did consider forming the HTML [with new background colours] on the
server side. This increases the CPU load on the server side. The
current model uses client side CPU to do the rendering and it works
fine in case of the rich client and incase of firefox browser. The
problem is only with IE. Once the page is loaded in IE, it takes 100%
CPU for couple of mins and then drops for a sec or so and then it takes
off again.

I donot think it is a problem with changing the style of the cells.
Just updating the cell values takes up a whole lot of CPU:

function updateTableCells()
{
var tbl = document.getElementById("tbl");
var tds = tbl.getElementsByTagName("td");
for(var k=0; k<tds.length;k++)
{
tds[k].firstChild.nodeValue = kk;
kk++;
if(kk>10000)kk=5000;
}
}



Reply With Quote
  #8  
Old   
Raj
 
Posts: n/a

Default Re: Perf prob with IE - 12-06-2004 , 09:46 PM



Quote:
Every 5 secs fresh data is downloaded from the server. The
downloaded
data is compared against the data currently being displayed in the
table. If any of the cells have changed, the javascript updates the
value of the cell and changes the cell color based on whether the
change is positive or negative from the previous value.

Quote:
This is not email. Your answer is read by many, so PLEASE quote a
relevant
part of the original. Follow usenet netiquette.
I am using http://groups.google.com which has pretty much gmail like
threaded view, so didnt realize the problems other face. Will
copy+paste the relevant parts ... sorry and thanks.

Quote:
Downloaded to a HTML table, how, why?
Then you loose the original table cell content, I suppose.
I suggest you do such comparing on the server, not on the client
browser.

Ok ... let me try to elaborate on the problem. The application shows
the prices of stocks being traded in a web page. When a user logs in to
the application, they can select the stocks they are interested in.
They are then taken to a page which shows the price [and other details]
of the stocks in the form of a table. Every 5 secs there is a script
which downloads the new price list [in csv format] and updates the
cells which have changed. The background colour of the cell is changed
based on whether the new value of the cell is more/less than the
current value.

We did consider forming the HTML [with new background colours] on the
server side. This increases the CPU load on the server side. The
current model uses client side CPU to do the rendering and it works
fine in case of the rich client and incase of firefox browser. The
problem is only with IE. Once the page is loaded in IE, it takes 100%
CPU for couple of mins and then drops for a sec or so and then it takes
off again.

I donot think it is a problem with changing the style of the cells.
Just updating the cell values takes up a whole lot of CPU:

function updateTableCells()
{
var tbl = document.getElementById("tbl");
var tds = tbl.getElementsByTagName("td");
for(var k=0; k<tds.length;k++)
{
tds[k].firstChild.nodeValue = kk;
kk++;
if(kk>10000)kk=5000;
}
}



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.