browserstate / history.js

History.js gracefully supports the HTML5 History/State APIs (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports jQuery, MooTools and Prototype. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.

Home Page:http://browserstate.github.com/history.js/demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High CPU usage

assembledadam opened this issue · comments

Got a dual quad core 2015 Macbook Pro, and I'm getting history.js using 12-16% of my CPU constantly (Chrome 52, MacOS El Capitan).

I've traced the problem to the call of History.onUnload = function() - this accounts for 90%+ of the CPU usage.

Specifically I think this is being called continuously - the offending line appears to be:

// For Internet Explorer
History.intervalList.push(setInterval(History.onUnload,History.options.storeInterval));

For non IE perhaps we should avoid this line?

Update: looks to be the same report as #321 and a couple of others. Seems odd why nobody has addressed this in the repo yet.