-
Notifications
You must be signed in to change notification settings - Fork 385
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
v2.13+: Syntax highlighting slowdown #2469
Comments
Correct, and that is why it is disabled by default. Android Text components have a notable penalty on dynamic font sizes. |
Hi, thanks a lot for the quick reply and explanation. |
hey @harshad1 , insight: there seems to be some performance degrade in the latest release. riveravaldez explcitly mentions bigger headings, but not seems specific to it, rather happens to be because it's one of the most tricky ones.
I could only find the heading one and otherwise generic references. As the header regex wasn't changed recently it seems pretty safe to say that it's in something in the highlighting processing chain and not some specific slow regex or font/span operation |
Indeed, precisely. Seems to me that Best regards and thanks a lot. |
I recently added logic to make highlighting happen on its own thread. This should have been a performance improvement overall Will investigate |
Note that highlighting and everything is going to be slow on very long files. Android's edit text is very inefficient when a lot of spans are present we have a system in markor which adds and removes spans as you scroll to reduce the total number present at any one time. Bigger headings (and todo.txt) have spans which don't work well with this so we manage these spans separately and do not adjust them dynamically. Both these cases will always be slower. |
@riveravaldez could you share a sample file and some more information on when you see the slowdown (typing? Scrolling? Typing at the top vs the bottom of the file?) |
Also also issue with plain txt files, turns out syntax highlights are enabled for default for .txt as well. Cross reference #2478 |
Possibly worth opening a new issue/discussion; what do you think about adding options/features to handle this from a user perspective. For example:
Most of my files are small, I have a small handful of larger files so I would definitely like syntax highlights on unless it's a large file. Rather than off then enable. The Todo.txt syntax highlighting is awesome! Hopefully threading change @harshad1 is looking at will have a positive impact 🤞 |
You should not have to worry about it. Also in the past not. It just not works well currently. You also should not need to constantly toggle it off and on, so its fine if it not bloats the immedate screen. |
Hi, sorry I didn't got the time to reply properly and with information. |
hi, thanx for this gem of app.
On a galaxy S7 (vanilla, installed from Google Store) I experience this slowdown since ~2 months with files smaller. No recent improvement, current version is v2.13.1 (no build number, taken from Settings/Apps). PS I didn't find where in |
On the More tab. |
@gsantner thank you for the quick reply. I just installed Markor v2.12.2 (code 151):
Performance is satisfactory and back to normal with both Syntax highlighting and Bigger headings turned on. RE version in the More tab: may I suggest the usual, expected location, at the bottom of the Settings pane. |
I am going to mark this as done. Please post if an issue appears again. |
dear @harshad1 the problem isn't solved, please don't close |
Ah ok. I will take another look.. |
Hi, sorry to bother, I'm using Markor from F-Droid, are you also or your version comes from Google Play Store? More in general: both versions are the same? 🤔 Best regards to everybody, 🍻 |
There is nearly no difference. On Google Play installation of APK is not allowed from Markor file manager, because Google disallows it (well, other filemanagers are allowed to, but Markor is not according to them). For syntax highlighting or editing there should is no different code. |
Assuming the question was directed to me:
|
@gsantner thank you for the quick response.
Something slows down Syntax Highlighting and Bigger Headings (enabled together or separately). It feels like excessive resource consumption: CPU, RAM or both. |
Could you try the version from this branch and see if he helps |
Hi, @harshad1 , everything is working fine here (check, #2469 (comment) ), I was checking just to verify if it wasn't some particular issue for Google Play Store users. My version from F-Droid is working normally (or even better with some of the new improvements). |
@otzoran could you check too |
…er navigation (PR #2487 closes #2469 #2484) * Keypress handler * Restored option, fixed duplicate calls to loadFolder on resume * Made some small changes for highlighting performance --------- Co-authored-by: Gregor Santner <[email protected]>
hi @harshad1
guessing you refer to the build artifact of CI #1171: Commit c897359 on your branch? best |
downloaded
Config: restored my Markor Test Results: Fine, no slowdown with Syntax Highlighting and Bigger Headings (enabled together or separately) on a file ~300KB that had the issues reported above. well done, thanx a lot |
👍 Just note that bigger headings are always going to cause some slowdown if there are a lot of them. You can probably edit a file 5x as big with bigger headings turned off. |
Description
Hi, I'm noticing in last version that: Settings → Edit mode → Bigger headings:
[Enabled] Edition becomes slow.
[Disabled] Edition returns to normality.
Noticeable in large .md files, with File settings → Syntax highlighting: Enabled. (Syntax highlighting: Disabled, also fix the issue.)
Apparently, more notorious when using system's auto-corrector or adding dots at the end of words?
Let me know if there's something I could do to help check this.
Thanks a lot for everything! <3
Steps to reproduce
Information
Android version: 10 (LineageOS version: 17.1)
Device: Moto E LTE 2015 (surnia)
App Version: 2.13.0 (155) - Added on 30/10/2024
Source
F-Droid
Format / File type
Markdown
Additional info / Log
The text was updated successfully, but these errors were encountered: