Closed Bug 1513937 Opened 6 years ago Closed 6 years ago

LSNG: Compress specific values

Categories

(Core :: Storage: localStorage & sessionStorage, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox66 --- wontfix
firefox67 --- wontfix
firefox68 --- fixed

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.
Blocks: 1513881
Priority: -- → P5
(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.
(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.
Blocks: 1540402
Assignee: nobody → jvarga
Status: NEW → ASSIGNED
Priority: P5 → P2
Depends on: 1545732
Depends on: 1546310

I have a patch for this, will send it soon.

My data.sqlite for twitter.com shrank from ~900K to ~200K.

Attachment #9062695 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Regressions: 1549365
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla68 → ---
Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68

(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.

Attachment

General

Created:
Updated:
Size: