saber icon indicating copy to clipboard operation
saber copied to clipboard

Lags, probably during autosave

Open Iey4iej3 opened this issue 2 years ago • 10 comments

Describe the bug

It seems that there are significant lags probably during autosave. A similar issue was solved months ago, and the current one appears only in very recent versions.

To reproduce

  1. Keep writing;
  2. Encounter the lag probably when an autosave is performed.

Expected behavior

No perceivable lag.

Saber version

v0.20.3

Device

  • Device: Samsung Tab S6 Lite
  • OS: Android 13

Anything else?

No response

Iey4iej3 avatar Mar 11 '24 16:03 Iey4iej3

  1. Are there images in note?
  2. Big amount of images?
  3. Large images?
  4. Or only hand writing?
  5. Do you synchronize to nextcloud?

QubaB avatar Mar 11 '24 18:03 QubaB

Only handwriting, and ~ 25 pages (@QubaB Sorry, previously I mistakenly opened another note and the number of pages is now corrected, although I have not tested systematically whether this could happen for documents with fewer pages). Synchronize to the official server.

Iey4iej3 avatar Mar 12 '24 10:03 Iey4iej3

I observe lag during autosave (created testing note with 10 pages of handwriting).

I do not know if this can be avoided. I do not understand source code enough to see if saving is done in another thread (on background) or whole Saber runs in only one thread and then saving should produce lags.

QubaB avatar Mar 13 '24 19:03 QubaB

I think that lag is caused by creation of note thumbnail during each Save. When I turned off creation of thumbnails (in developer version), lagging was not almost noticable.

I will try to create fix, which will implement that during autosave is not created thumbnail.

QubaB avatar Mar 14 '24 07:03 QubaB

I do not understand source code enough to see if saving is done in another thread (on background) or whole Saber runs in only one thread and then saving should produce lags.

It is done in background: https://github.com/saber-notes/saber/issues/179#issuecomment-1615265288

Iey4iej3 avatar Mar 14 '24 15:03 Iey4iej3

I think that lag is caused by creation of note thumbnail during each Save.

I guess that thumbernails should be produced when the notes are closed. Doing it during autosaves does not seem to be meaningful, indeed.

Iey4iej3 avatar Mar 14 '24 16:03 Iey4iej3

I experienced a lot of lags too, with Appimage v0.21.4, even on short notes (3 pages, but with a few emoji images).

Polux49 avatar Apr 30 '24 15:04 Polux49

This feature is not implemented yet. See pull request #1136

QubaB avatar Apr 30 '24 16:04 QubaB

I was also experiencing lags during autosave. I have disabled autosave and just make sure I save before I exit. Dramatically improved the usage of the app.

danielwmoore avatar May 13 '24 20:05 danielwmoore

I haven't done an exhaustive search, but 0.21.0 seems to not have this issue. I reckon it's caused by a95f44bb2d275d57cabb42f3779bd13019cbf725, which makes it a duplicate of #1189. Autosaving causes roughly the same amount of lag as simply saving to exit.

6b6279 avatar Sep 15 '24 10:09 6b6279