history.js icon indicating copy to clipboard operation
history.js copied to clipboard

High CPU usage

Open assembledadam opened this issue 9 years ago • 1 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?

assembledadam avatar Aug 10 '16 02:08 assembledadam

Update: looks to be the same report as https://github.com/browserstate/history.js/issues/321 and a couple of others. Seems odd why nobody has addressed this in the repo yet.

assembledadam avatar Aug 10 '16 10:08 assembledadam