Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laggy strokes #179

Closed
FoilCan opened this issue Dec 27, 2022 · 38 comments
Closed

Laggy strokes #179

FoilCan opened this issue Dec 27, 2022 · 38 comments
Labels
bug Something isn't working

Comments

@FoilCan
Copy link

FoilCan commented Dec 27, 2022

Describe the bug
Writing using S-pen get laggy (the strokes appear with delay) after writing certain amount of strokes. It is not so annoying at first, but quickly gets quite bad.

To Reproduce
e.g. Try to solve some problem with matrices (which obviously requires a lot of strokes).

Device (please complete the following information):

  • Device: Galaxy Tab S6 lite
  • OS: Android 12 (Lineage OS)
  • Version: 19-20221204-microG-gta4xl

P.S. Love the app, keep up the good work.

@FoilCan FoilCan added the bug Something isn't working label Dec 27, 2022
adil192 added a commit that referenced this issue Dec 28, 2022
@adil192
Copy link
Member

adil192 commented Dec 28, 2022

I haven't had the chance to replicate this because I'm home for the holidays. Please can you try this beta apk in Build #98 when it's finished building?
(The signature is incompatible with the Google Play and F-Droid builds, so if you installed Saber from there, you'll need to uninstall it before installing the beta apk)

@FoilCan
Copy link
Author

FoilCan commented Dec 28, 2022

Reducing the history size seems to have reduced the lag a bit. But it still gets quite laggy after drawing a log of strokes.
I have also noticed that the lag is way less noticeable when there are less strokes displayed on the screen, even if there are a lot of strokes in the whole note. Like when I zoom in on some area of the page or scroll to a next page, with less strokes.
Perhaps it has something to do with rendering of the strokes?

adil192 added a commit that referenced this issue Dec 29, 2022
@yephny
Copy link

yephny commented Dec 29, 2022

It gets laggy when you draw on an image, while there's no lag on the white space next to the image. It does look like there's something wrong with rendering strokes.

adil192 added a commit that referenced this issue Dec 31, 2022
@adil192
Copy link
Member

adil192 commented Dec 31, 2022

For future reference, I've made this file with tons of strokes and two pictures.

Saber stress test.sbn

@adil192
Copy link
Member

adil192 commented Dec 31, 2022

Update: Lag has been reduced quite a lot with 66b3fa0

If any of you want to try this out before the next release, download an apk from here

@FoilCan FoilCan closed this as completed Jan 2, 2023
@FoilCan FoilCan reopened this Jan 2, 2023
@FoilCan
Copy link
Author

FoilCan commented Jan 2, 2023

For future reference, I've made this file with tons of strokes and two pictures.

Saber stress test.sbn

Is there a way to open .sbn files on android at the moment?

@adil192
Copy link
Member

adil192 commented Jan 2, 2023

Is there a way to open .sbn files on android at the moment?

Not yet, see #196

@adil192
Copy link
Member

adil192 commented Feb 19, 2023

@FoilCan Is lag still an issue in the latest versions?

@FoilCan
Copy link
Author

FoilCan commented Feb 24, 2023

untitled2.mp4

It is considerably better in the new versions, but it is still quite laggy when the whole page is filled with strokes. (attached video, recorded on v0.9.4)

Also the "All notes" interface is laggy when scrolling as well as when opening a note.

@adil192

@toobaz
Copy link
Contributor

toobaz commented Mar 7, 2023

@FoilCan Is lag still an issue in the latest versions?

With v. 0.9.3 (F-Droid 9030, in case it matters) I do experience this a lot. My tablet is not very modern (Exynos 7870 Octa CPU from 2016) and after 10 pages or so of notes - not even very full - the lag (to strokes, but also to the UI, when waiting for a stroke to appear) becomes heavy.

Notice that

  • it's not related to undo history: if I close and reopen the document (so undo history emptied), the problem is still there
  • it's not related to the specific page I am drawing on: if I get to a blank page after 10 or so pages of notes, the problem is still there
  • ... which for instance implies that whether or not the stroke intersects other strokes doesn't seem to matter: and indeed, I do get strokes that intersect many other strokes, even after 10 pages of notes, to occasionally appear without lag
  • it's very irregular: occasionally I will get strokes that appear immediately, and just after one very similar one that takes 5 seconds to appear
  • if anything, my experiments suggest that lags are more likely to occur on paths that I take more time to draw: it's difficult to distinguish duration from complexity, but it seems to me that not only quick straight paths, but also curved paths that I draw quickly will very rarely have lag; the same circle is less likely to appear with a lag if I draw it quickly (which I guess corresponds to less control points...)

@adil192
Copy link
Member

adil192 commented Mar 15, 2023

It looks like this may be an upstream issue. There's lots of issues in the flutter repo but this one seems to be the most active:

Go ahead and give it a thumbs up to bring attention to it

@m0byn
Copy link

m0byn commented Apr 23, 2023

I honestly do not know how other Android users actually are using the app. I am really trying hard since I want to support this project, very much like the vision of this project, and really like every aspect of the app, except the laggyness of the strokes. I am still using the application, but the laggyness is not manageable. Sometimes, strokes take up to 2 or 5 seconds to display. Is there anything what can be done? I already gave the upstream issue a thumbs up, but every day I keep asking myself whether I keep using it or not, if it is not fixed. I am really hoping the upstream issue will be fixed any time soon!

@toobaz
Copy link
Contributor

toobaz commented Apr 23, 2023

I honestly do not know how other Android users actually are using the app.

Most of the time, lags remain manageable in my notes. But when they don't, the only "solution" I found is to continue in a new note...

@m0byn
Copy link

m0byn commented Apr 24, 2023

Hm...yeah I tried that too, but it is difficult to keep track and organise if you have to open a new note after every full page. But thank you very much for your response!

@Iey4iej3
Copy link

Iey4iej3 commented Apr 27, 2023

I do notice the sluggishness on Saber 0.11.3 (F-Droid build) on my Samsung Tab S6 Lite, also on Lineage OS, especially in comparison to a very old app https://f-droid.org/en/packages/com.write.Quill/

I am not sure whether it is relevant (for example, because of using the same library). I also encounter the sluggishness in Xournal++.

@minnten
Copy link

minnten commented May 5, 2023

Still, I have the same Issue with v 0.12.0 from Google Play or the AppImage.
I do net get the error on other Apps like Xournal++ on my Yoga-Laptop or Samsung Notes on my Samsung Tab Active Pro.

@Iey4iej3
Copy link

Iey4iej3 commented May 5, 2023

I also encounter the sluggishness in Xournal++.

I forgot to mention that Xournal++ is on Android, not laptop: https://f-droid.org/packages/online.xournal.mobile/

@m0byn
Copy link

m0byn commented May 26, 2023

@adil192 could you have a look at the upstream isse here and discuss? I commented some days ago, got a reply, but do not have the knowledge to answer.

@adil192
Copy link
Member

adil192 commented May 26, 2023

The Impeller backend is currently only available in Saber for iOS. I'm not really able to reproduce these lags anymore, but then again I have fairly new devices. If anyone has an older iPad/iPhone, please can they test the performance on there?

@adil192
Copy link
Member

adil192 commented May 26, 2023

untitled2.mp4

It is considerably better in the new versions, but it is still quite laggy when the whole page is filled with strokes. (attached video, recorded on v0.9.4)

Also the "All notes" interface is laggy when scrolling as well as when opening a note.

@FoilCan Please can you try re-recording this scenario on the latest version?

@m0byn
Copy link

m0byn commented May 26, 2023

Strokes are still very laggy in my case. I use a Samsung Galaxy Tab S6 (not the lite version - so more powerful) which is neither too old...

On the following video you can see the pointer of the pen and the lagginess!

Lagging.mov

Device: Samsung Galaxy Tab S6
OS: LineageOS 20 (Android 13)
Saber version: 0.12.7

@Iey4iej3
Copy link

The Impeller backend is currently only available in Saber for iOS. I'm not really able to reproduce these lags anymore, but then again I have fairly new devices. If anyone has an older iPad/iPhone, please can they test the performance on there?

What about (potentially) experimental versions mentioned in https://docs.flutter.dev/perf/impeller#android

@adil192
Copy link
Member

adil192 commented May 26, 2023

What about (potentially) experimental versions mentioned in https://docs.flutter.dev/perf/impeller#android

I've tried it and it's pretty unusable in its current pre-preview state

@FoilCan
Copy link
Author

FoilCan commented May 27, 2023

The lags seem to have improved when it comes to writing responsiveness (was not able to reproduce laggy behavior), erasing however seems to still be laggy or perhaps it became laggy, since I do not remember it being laggy.

Saber version: 0.12.8 (FOSS)

untitled.mp4

@Iey4iej3
Copy link

The lags seem to have improved when it comes to writing responsiveness (was not able to reproduce laggy behavior), erasing however seems to still be laggy or perhaps it became laggy, since I do not remember it being laggy.

Saber version: 0.12.8 (FOSS)

The lags for writing is still reproducible on 0.12.7 (F-Droid), but I have to write many pages from scratch to reproduce it, and it seems to be improved. However, if I write on a new page of an existing notebook (7 pages), the lag is still significant.

@adil192
Copy link
Member

adil192 commented May 27, 2023

erasing however seems to still be laggy or perhaps it became laggy, since I do not remember it being laggy

I may have been able to fix this just now in de82220

@m0byn
Copy link

m0byn commented May 30, 2023

I do not know how you managed to achieve it but writing and erasing works much smoother now, almost without any lag! I will test it and report here. The version I am using is 0.12.9 on Android.

Keep up the good work!!

@Iey4iej3
Copy link

Iey4iej3 commented Jun 2, 2023

The lag is much improved but still reproducible when I continuously write a lot (which happens when I take notes for a class, say) in the latest build.

@m0byn
Copy link

m0byn commented Jun 2, 2023

True. I can confirm that. As soon as I have more information on that I will post again.
EDIT: I can definitely confirm that it is still laggy on notes with much writing on. Also, it seems to me that it is still primarily related to the eraser.
If there is any way to increase efficiency, I would vote for it!
EDIT 2: it is definitely related to the eraser. In fact, many times I click the eraser and start erasing, it just hangs for several seconds (yes, seconds!). Then, erasing is not working fluently, but laggy. If there is any way I can help to identify the issue please let me know and I will do my best to help!!

@m0byn
Copy link

m0byn commented Jun 19, 2023

I do not know how you managed to achieve it but writing and erasing works much smoother now, almost without any lag! I will test it and report here. The version I am using is 0.12.9 on Android.

Keep up the good work!!

Apparently, there is some movement going on in the upstream issue. I do not know @adil192 whether your are following that or not. Unfortunately, I am not skilled enough to evaluate whether it is of use for this app or not, it may be worth having a look at!

@Iey4iej3
Copy link

Iey4iej3 commented Jun 25, 2023

My observation is that, the lag seems to be significant right after (not during) an autosave. The latest version has much more indications, and I find that, right after that the top left save button vanishes with a rotating circle which also vanishes (which seems to indicate that an autosave is finished), there is a 1-2 second lag.

This can also be triggered manually as follows:

  1. Write something (on a notebook or on the whiteboard);
  2. Click the save button on the top left;
  3. Immediately start writing things again.

As far as I observe, the stroke is not laggy when the icon is rotating (which seems to indicate that it is saving), but after that, it becomes laggy (and after the stuck, seemingly the canvas is refreshed).

@adil192
Copy link
Member

adil192 commented Jun 28, 2023

@Iey4iej3 I suspect that this is because the file is being encrypted and uploaded. 59c5ade should make the encryption less blocking (in the next update after v0.14.0).

@Iey4iej3
Copy link

@Iey4iej3 I suspect that this is because the file is being encrypted and uploaded. 59c5ade should make the encryption less blocking (in the next update after v0.14.0).

Thanks. It is probably closely related to the synchronization. When I disable that, I do not see lags (but I did not test extensively). Is it possible to synchronize in background (by, say, keeping a memory copy during the autosave)?

@adil192
Copy link
Member

adil192 commented Jun 30, 2023

Well it's already running in the background. The problem is that the encryption blocks the main thread, which the commit tries to fix

@Iey4iej3
Copy link

Iey4iej3 commented Jul 14, 2023

After taking notes for two weeks, I confirm that the lag is improved, but still happens occasionally (and now I do not have a robust way to reproduce it). I still suspect that it is related to the computational overhead of encryption.

PS: seemingly this happens more frequently when there are more than 10 pages, say.

@Iey4iej3
Copy link

Sometimes it is extremely laggy. It seems to be the case when there is no Internet connection. Not sure whether it is a newly introduced bug.

@Cyanogenbot
Copy link

Cyanogenbot commented Oct 5, 2023

I seem to have lag on some parts of my notes too on my ipad (pro 2018). I have attached my .sbn2 file and a video for reference
even on the homepage this seems to be the case... Any idea to change the homepage to small jpg snapshots or something alike? once drawings are out of sight its all fast

saberlag.sbn2

Rpreplay.Final1696496258.mp4

@adil192
Copy link
Member

adil192 commented Dec 2, 2023

Any idea to change the homepage to small jpg snapshots or something alike? once drawings are out of sight its all fast

Yes that's one of the objectives in my university project. It'll be done soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants