views:

1352

answers:

1

Summary

jquery is used to retrieve search results via the get() call. When rendering the bulk of results there is no problem, but then when rendering part of the results, IE7 consistently hangs for 5-30 seconds before rendering.

Problem

The get() call in jquery successfully executes. There is no eval() or urlencode or decode on the data, as the data is html. A large content area is replaced with the data via

$('#content').html(data);

Within #content there are a couple hidden divs that contain content to be moved to another areay outside #content. (these are search results retrieved via ajax, and the breadcrumb needs to be updated in another section)

$('#breadcrumb').html($('#content #breadcrumbcontainer').html());

The above works very well in Firefox and other browsers.

Testing on a Vista machine with IE 7.0.6001.18000 without script debugger was fast and normal in all cases.

Testing on XP with 7.0.5730.11 with MS script debugger was slow on a number of occasions. I can only guess at this point - it looks like it has something to do with

  1. script debugger being installed
  2. invalid XHTML strict
  3. caused by some obscure timing - the fix I've seen suggested here using setTimeout()
  4. perhaps jquery queue is needed?
  5. some combination of the above

More code can be provided, but it's really confounding that the performance is so bad (30 seconds rendering) when it's 1 second in IE7 without script debugger.

Any suggestions as to the cause would obviously be appreciated.

-- update --

The tskmanager shows now CPU usage for iexplorer.exe while it is idling. Just hangs, like there's a timeout.

-- update two --

It has been confirmed that IE7 without microsoft script debugger that IE7 is slow

Range: 4 seconds to 2:19 Average: 33 seconds Median: 18 seconds Standard deviation: 37 seconds

A: 

The problem came from a fact which I omitted - which is that the search results, each one, contains an flash object. removing the flash object makes the speed comparable to FF.

The flash is now loaded after $(document).ready() using swfobject, and the problem has disappeared.

The behavior was inconsistent because IE7 will cache the flash object - so sometimes the performance will be normal.

Jonathan Hendler
I have noticed a lot of problems with the way that IE's caching works and using jquery.
Tom Anderson