Closed
Bug 1513937
Opened 6 years ago
Closed 6 years ago
LSNG: Compress specific values
Categories
(Core :: Storage: localStorage & sessionStorage, enhancement, P2)
Core
Storage: localStorage & sessionStorage
Tracking
()
RESOLVED
FIXED
mozilla68
People
(Reporter: janv, Assigned: janv)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
IndexedDB compresses every structured clone before storing it in the database. It uses snappy for that which provides good compression ratio and very fast compression/decompression.
We could do something similar for LS too with few modifications:
1. Compress values only if their length exceeds given threshold.
2. If compressed length is close to original length, store it uncompressed.
3. Do compression/decompression in the content process to mitigate the overhead that must be sent across IPC and do less CPU heavy work in the main process.
This can also be used for "storage" event notifications.
Hopefully, compression would help with issues like bug 1475218.
Updated•6 years ago
|
Priority: -- → P5
Comment 1•6 years ago
|
||
(In reply to Jan Varga [:janv] from comment #0)
> 2. If compressed length is close to original length, store it uncompressed.
For this, :bkelly's comment at https://bugzilla.mozilla.org/show_bug.cgi?id=1132041#c5 is probably relevant, wherein he passes on the wisdom that Snappy should not meaningfully bloat the data if it doesn't compress well. So from a code complexity perspective, it might be simplest to just always use Snappy compression.
Assignee | ||
Comment 2•6 years ago
|
||
(In reply to Andrew Sutherland [:asuth] from comment #1)
> (In reply to Jan Varga [:janv] from comment #0)
> > 2. If compressed length is close to original length, store it uncompressed.
>
> For this, :bkelly's comment at
> https://bugzilla.mozilla.org/show_bug.cgi?id=1132041#c5 is probably
> relevant, wherein he passes on the wisdom that Snappy should not
> meaningfully bloat the data if it doesn't compress well. So from a code
> complexity perspective, it might be simplest to just always use Snappy
> compression.
Ok, good to know. Thanks for the pointer.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jvarga
Status: NEW → ASSIGNED
Assignee | ||
Updated•6 years ago
|
Priority: P5 → P2
Assignee | ||
Comment 3•6 years ago
|
||
I have a patch for this, will send it soon.
Assignee | ||
Comment 4•6 years ago
|
||
My data.sqlite for twitter.com shrank from ~900K to ~200K.
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
Assignee | ||
Comment 7•6 years ago
|
||
Updated•6 years ago
|
Attachment #9062695 -
Attachment is obsolete: true
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1bd31177b14
LSNG: Compress specific values; r=asuth
Comment 9•6 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Comment 10•6 years ago
|
||
Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.
status-firefox67:
--- → ?
Comment 11•6 years ago
|
||
Backout by ryanvm@gmail.com:
https://hg.mozilla.org/mozilla-central/rev/df3eadfa74a8
Backed out 8 changesets (bug 1513937, bug 1546310, bug 1548788, bug 1547688, bug 1547452, bug 1540777, bug 1542669, bug 1547454) for causing bug 1549362.
Updated•6 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla68 → ---
Comment 12•6 years ago
|
||
Pushed by jvarga@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/6f45208b6065
LSNG: Compress specific values; r=asuth
Comment 13•6 years ago
|
||
bugherder |
Status: REOPENED → RESOLVED
Closed: 6 years ago → 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Assignee | ||
Comment 14•6 years ago
|
||
(In reply to Jan Varga [:janv] from comment #4)
My data.sqlite for twitter.com shrank from ~900K to ~200K.
www.linkedin.com shrank from 1583104 to 745472 bytes on disk.
You need to log in
before you can comment on or make changes to this bug.
Description
•