gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.7k stars 360 forks source link

Slowed typing after reaching 500kb in file size #1743

Closed zeplar-exe closed 2 years ago

zeplar-exe commented 2 years ago

⚠️ This issue respects the following points: ⚠️

Description

When trying to edit one of my larger markdown files (500kb), typing suddenly slows to a halt. There is no gradual decrease in performance as the file gets larger. Typing a single character takes up to 7 seconds, and general responsiveness is halted. Key presses can also be built up and not have a delylay themselves.

Steps to reproduce

  1. Create a file
  2. Enter ~500kb of text
  3. Observe painfully slow typing speed

Information

Android version: 12 (seen on Android 11 as well) Device: Galaxy A13 App Version: 2.9.0

Source

APK

Format / File type

Markdown

Additional info / Log

- This only happens in markor
- This can be observed with any keyboard (Samsung keyboard, external keyboards)
- Other functionality is not affected
gsantner commented 2 years ago

App Version: 2.8.0

Update to 2.9.0. And no, Google Play is not updated anymore.

zeplar-exe commented 2 years ago

Update to 2.9.0.

Already updated to 2.9.0, forgot to edit that. The problem still occurs, and the delay is somewhat longer.

harshad1 commented 2 years ago

Turn off highlighting for the file. 3 dot menu -> file settings

zeplar-exe commented 2 years ago

I don't have highlighting enabled. @harshad1.

Enabling and disabling it doesn't change anything either.

harshad1 commented 2 years ago

Try disabling all accessibility related things in settings on your phone? This was addressed some time ago, but maybe there is something I missed?

I am not able to reproduce this on my phone (pixel 3 xl)

zeplar-exe commented 2 years ago

No changes. @harshad1

harshad1 commented 2 years ago

Try turning auto-formatting off as well? (Right next to highlighting)

zeplar-exe commented 2 years ago

No changes. Disabling wrap words doesn't change anything either. @harshad1

CtrlAltCuteness commented 2 years ago

Likely the issue lies around the fact that the device's RAM is getting overwhelmed by Markor having this large file in memory as well as other various background apps loading and unloading in memory. If something existed similar to vim's swap files for Markor, this might lower the issues that you are experiencing there.

By the way, is it possible for you to state how much storage space you have left on your device? Android is somehow known to be very slow if the remaining storage space gets low.

If there is plenty of space left, you can just reply with the amount of storage space used / remaining and how much storage space you got in total, optionally continue reading for a few tips. Otherwise, if it is relatively low, write it down so you can reference it in a new reply after we update the Media Database.

Back up some of your stuff to a computer / etc. before removing it to free up enough room for the file manager app Fx File Explorer - Google Play Store (note: the unlock key called Fx Plus will not be needed for this task). Some apps don't properly update the Media Database when they read or write files. If this is the case, you might have a bunch of thumbnails existing for files / videos / etc. you have deleted long ago.

Swipe all apps off the recent apps list (save everything first if you want to keep them), copy a single space (kinda important), and if you have a clipboard with history, make sure to completely clear that out.

  1. Start up Fx and, if this is your first time running it, go through the basic setup and tutorial it has.
  2. Go into Settings on the left pane (if that pane is not showing, it will be in the triple line menu in the top left).
  3. In the Files and Media category, go into Thumbnails.
  4. Uncheck Thumbnails at the top and tap back until you get back to the Home.
  5. Go into your Main Storage (or the primary SDCard if you don't have a Main Storage).
  6. Make sure you are at the root of this storage and not any subdirectory ("folder") inside of it,
  7. In the top right triple dot menu, at or near the bottom is Rescan Media.
  8. Let it run, which may take some time depending on how much you have on there as well as how many entries are not in the Media Database or are there but the file no longer exists.

Now exit Fx (you may uninstall Fx if you want to now) and reopen the same storage thing you used before. Reply back the amount you had before and after (as well as if Fx is still installed).

Aside: I'm not trying to advertise this app. It is just the easiest way that I know of to do this task quickly and painlessly.

CtrlAltCuteness commented 2 years ago

Sorry for the extra reply. This is mainly intended for @zeplar-exe but it also will be helpful for @harshad1 to know the results.

zeplar-exe commented 2 years ago

@CtrlAltCuteness 48/64 GB used. Surely more than enough.

I tested my RAM. With no other apps open besides settings and my file in markor, I'm at 1.4/3 GB of memory available.

harshad1 commented 2 years ago

Yeah, markor uses very little ram. Even with a large file with highlighting enabled it would be only a few MB.

Jul. 13, 2022 17:34:59 Zander Baker @.***>:

@CtrlAltCuteness[https://github.com/CtrlAltCuteness] 48/64 GB used. Surely more than enough.

I tested my RAM. With no other apps open besides settings and my file in markor, I'm at 1.4/3 GB of memory available.

— Reply to this email directly, view it on GitHub[https://github.com/gsantner/markor/issues/1743#issuecomment-1183816124], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAOZ3TCJDGGQHW2PMIB2VO3VT5ODDANCNFSM5ZZFI2YA]. You are receiving this because you were mentioned.[Tracking image][https://github.com/notifications/beacon/AAOZ3TGDYS3KHMEMVV4ERZ3VT5ODDA5CNFSM5ZZFI2YKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI2HZTPA.gif]

gsantner commented 2 years ago

I released Markor v2.10.0 today, I know it has lots of performance improvements, so might help here as well. See https://github.com/gsantner/markor/discussions/1760.

Generally speaking, there are by feeling really many performance X is slow Y takes long topics already open in the bugtracker. Closing this one as duplicate, I know you want it to work better, everybody does, but writing (or writing again) descriptions doesn't improve it for sure :smile: . This topic of "~1MB+ file loading slow" has been coming up as long the project exists.

Currently we talk here what we can do.

zeplar-exe commented 2 years ago

The loading itself isn't even that slow though. I couldn't find any issues that describe poor keyboard performance.

gsantner commented 2 years ago

Possible that you have much in your clipboard? I sometimes have i.e. a whole File base64 encoded in the clipboard .... and then when I open Firefox on Android it crashes ... because the browser has a option "open link from clipboard", which reads this out and makes issues. Maybe your keyboard has such a feature and have a filled clipboard too?

zeplar-exe commented 2 years ago

No changes with a cleared clipboard, unless SwiftKey is hiding things from me. I updated to 2.10 too.

zeplar-exe commented 2 years ago

Turns out the default keyboard was storing copied text. I cleared that and had good performance for about 5 seconds. Not sure what to think.

zeplar-exe commented 2 years ago

Not really completed though. The problem persists after typing a word or two.

Addisonbean commented 8 months ago

@zeplar-exe Have you found a fix for this? I'm having the same issue using the latest version (2.11.0) on a file that's just over 500kb. I also have syntax highlighting off for the file too.

Edit: I tried installing a few more keyboards, and Gboard is the only one so far that works flawlessly... I guess I'll be using that for now. (SwiftKey and the Samsung one both were unusable with this file in Markor).