10ten-ja-reader icon indicating copy to clipboard operation
10ten-ja-reader copied to clipboard

Data size takes over 400MB after v0.4.0 update

Open zdzc opened this issue 3 years ago • 3 comments

After I upgraded to v0.4.0, the dictionary size ($HOME/.mozilla/firefox//storage/default/<extension_id>) grows much more bigger than it used to. On the previous version it took about 280MB, now it takes over 400MB. Is there any way to reduce the file size of the dictionary?

zdzc avatar Apr 11 '21 02:04 zdzc

Hi! Sorry about that. Unfortunately the SQLite database used to stored IndexedDB data in Firefox is not very compact. The advantage of the 120Mb increase in disk usage is a 70Mb decrease in memory usage and I think for most people that's a good tradeoff.

If that's causing problems I think the options available would include:

  1. Try to reduce the h index on the words table to only include entries that don't exist in other the other rm and km indices. This would complicate processing somewhat and might not save much disk space but might be worth a try.
  2. Add the option to not download the names database for users who don't need it.
  3. Add the option to not download the words database (and simply fallback to the less up-to-date English-only memory-consuming version every time).

So (1) might be worth investigating but would only help with new installs / re-installs since we probably wouldn't want to clobber the existing index in existing installations.

birtles avatar Apr 12 '21 00:04 birtles

I use profile-sync-daemon, which basically mirrors Firefox profile to tmpfs (RAM). I could increase the tmpfs size, so it's not much of a big deal.

For option number 2, can it be applied to the Kanji dictionary section (Kanji components, Classic Nelson, and so on)?

If it's too complicated to implement, I think it's okay not to do it. Probably not many people is troubled by the increase of disk usage.

zdzc avatar Apr 12 '21 13:04 zdzc

Thanks!

Unfortunately the kanji dictionary is so small that even dropping it altogether would not save much disk space. I think it is about 10% of the size of the names / words dictionaries each.

Through the bug-reporting utility, I can see that a number of users are still hitting quota exceeded errors so option 1 is probably worth investigating at some time. However, unless I hear more reports I think it is probably not a high priority just yet.

birtles avatar Apr 14 '21 00:04 birtles