Skip to main content

Bug Tracker

Side navigation

#5646 closed bug (worksforme)

Opened December 12, 2009 12:25AM UTC

Closed October 31, 2010 09:37PM UTC

Long AJAX request takes all CPU on Chrome

Reported by: SamePaul Owned by:
Priority: minor Milestone: 1.4
Component: ajax Version: 1.3.2
Keywords: ajax chrome Cc:
Blocked by: Blocking:
Description

As I noticed jQuery does not use onredaystatechange callback of XMLHTTPRequest, but instead uses timer to frequently poll readyState property.

Resolution set to be 13 milliseconds, which seems to be overkill. Moreover on Google Chrome it causes 100% CPU load during active AJAX requests.

I changed polling interval to 100ms and observed normal CPU load without noticeable sacrificing in XHR response, because for human difference between 10ms and 100ms absolutely negligible, but for browser it makes sense.

Moreover, I think that offloading browser from such a frequent task jQuery lets it process other events more quickly, thus improving overall web application performance.

Attachments (0)
Change History (2)

Changed June 13, 2010 11:07PM UTC by dmethvin comment:1

component: unfiledajax

Changed October 31, 2010 09:37PM UTC by snover comment:2

resolution: → worksforme
status: newclosed

Current versions of jQuery use onreadystatechange and do not poll.