Closed Bug 698514 Opened 8 years ago Closed 8 years ago

session saving causes non-responsiveness, from jank to full-on hangs

Categories

(Firefox :: Session Restore, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 669034

People

(Reporter: dietrich, Unassigned)

Details

While bug 485976 was fixed, there are other problems, such as stringifying JSON for large sessions.

I've noticed the jank when sessionstore.js is updated, according to my new profiling tool (Finder, sorted by last modified).

The jank is detected by watching http://leaverou.github.com/animatable/ with "animate all" selected.
Blocks: 698500
(In reply to Dietrich Ayala (:dietrich) from comment #0)
> While bug 485976 was fixed, there are other problems, such as stringifying
> JSON for large sessions.

I brought this up when we talked about this before but I'll say it again. Stringifying is likely hurting. Especially since it currently happens on ui thread.

One thing we're doing which is hurting us: passing an exclude function to JSON.stringify. In fact, I just did some timing and with a 472K sessionstore.js (200+ tabs) the exclude callback is resulting in a ~4x slowdown (w/ exclude: 126ms, w/o exclude: 29ms).

So we should probably stop doing that. I like that we filter stuff out, but at that cost, it's probably not worth it. Or we fix it so we do it off the ui thread.
Filed bug 698565 for the key exclusion part.
Depends on: 698565
To further mitigate the stringification pain, maybe we could JSON.stringify() smaller pieces of the data in steps using a timer+generator, and stitch them together manually into the final mega-object.
duping against bug 669034, which has more discussion already on this subject.
No longer blocks: 698500
Status: NEW → RESOLVED
Closed: 8 years ago
No longer depends on: 698565
Resolution: --- → DUPLICATE
Duplicate of bug: sessionRestoreJank
You need to log in before you can comment on or make changes to this bug.