-
Notifications
You must be signed in to change notification settings - Fork 5
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
lag when redrawing >300 strokes. #4
Comments
Thanks for supporting FastDraw! |
I test it on physical iPad Pro M1 with Apple Pencil. This problem is obvious with fast handwriting using pencil. I also notice the real device CPU and Memory usage is low even though the rendering issue is significant at thousands strokes. Another question is: If CALayers is not ideal, is there any way to make this scalable to, say, 1 million strokes? Thanks again and I looks forward to your update. |
Thanks, I will study it soon |
Hi, I am also testing on physical iPad Pro M1 with Apple Pencil, and it seems that I arrive at similar conclusion to yours. I have generated 300 strokes each with 100 UIBeziercurves (which is 30000 beziercurves in total), and the redraw time becomes 0.2 seconds, generally a redraw time below 0.1 second is unnoticeable. |
I was using FastDraw to implement a handwriting note app. When I wrote 300~ words, the stroke count is around 2000. Assuming 3 curves per stroke, that is 6000 curves. The canvas is basically sluggish at this point. 300 handwritten words takes up roughly half of virtual A4 paper. I hope this gives you a better context about my specific use case, and whether it has hit the library's intended limitation. Thanks! |
Usually a stroke takes more than 3 curves, it is about 10 in common. I think that might be the problem, I will work on improving the performance asap. |
Hi, first and foremost I love your project.
I faced an issue where the drawboard becomes laggy when it has to render more than 300 strokes. At 1900 strokes,
The drawboard is basically lagging one stroke behind, stroke data such as stroke points and width are not fully captured as well.
I found the culprit to be self.setNeedsDisplay(). It will redraw the whole canvas after each stroke, which after 1900 strokes, it would take 1 seconds to complete the repaint, which is unusable for handwriting.
Few ideas on top of my mind:
CALayers
Thanks!
The text was updated successfully, but these errors were encountered: