Open Bug 1968317 Opened 1 year ago Updated 1 year ago

Session Restore shouldn't save redundant copies of data-URI-favicon data

Categories

(Firefox :: Session Restore, defect, P3)

defect

Tracking

()

People

(Reporter: sfoster, Unassigned)

References

Details

(Whiteboard: [fidefe-session-restore])

If you've got e.g. hundreds of tabs from the same site open (bugzilla in my case), then Session Store appears to save a distinct copy of the base64-encoded favicon for each tab. For bugzilla.mozilla.org's 128x128 PNG favicon, that data URI is 186969 characters long, i.e. nearly 200KB i.e. 0.2MB. So: if you have 200 bugzilla tabs open, then that represents 200 * 0.2MB = 40MB of json that Firefox needs to re-serialize as part of your session state. That's quite a lot.

Severity: -- → S3
Priority: -- → P3
Whiteboard: [fidefe-session-restore]

FWIW there are old WIP patches in bug 1546847 which unfortunately recently got duped to bug 1849393 for reasons that I don't fully understand.

See Also: → 1546847, 1583384, 1849393

Though also, based on bug 1546847 comment 34, it's not clear how much this would help in practice.

(In reply to :Gijs (he/him) from comment #2)

Though also, based on bug 1546847 comment 34, it's not clear how much this would help in practice.

Yeah its probably not the magic bullet. But surely removing the duplicates and reducing the size of the data structure we serialize and write to disk wouldn't hurt and might help a great deal in some cases where its a particularly large session and there's memory pressure or other constraints. A 40MB string is just a lot. But agreed we should get some numbers before investing a lot of time into this.

(In reply to Sam Foster [:sfoster] (he/him) from comment #0)

For bugzilla.mozilla.org's 128x128 PNG favicon, that data URI is 186969 characters long, i.e. nearly 200KB i.e. 0.2MB. So: if you have 200 bugzilla tabs open, then that represents 200 * 0.2MB = 40MB of json that Firefox needs to re-serialize as part of your session state. That's quite a lot.

Note, this^ information about bugzilla's favicon is out of date (originally from bug 1867137 comment 0). Bugzilla's favicon is now 48x48 and encodes as a ~20,000-character-long data URI (an order of magnitude smaller than the 186,969-character-length data URI that it used to require).

So specifically for sessions with many bugzilla tabs, this isn't quite as bad as it used to be, but it'd still be nice to optimize away redundant copies of that 20,000-character data-URI if possible.

You need to log in before you can comment on or make changes to this bug.