Ticket #5646 (closed bug: worksforme)
Long AJAX request takes all CPU on Chrome
|Reported by:||SamePaul||Owned by:|
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.