Sourceful
Sourceful copied to clipboard
Very slow for large files
I open this issue here because the SourceEditor repo is inactive. When editing large files, my app takes a lot of time to highlight code typed in the text view, it blocks the main thread so it's very hard to type. On my iPhone 7, the app is slow for files with 300+ lines and for 1000+ lines, it's very unusable. On my iPad 6th gen, it begins to be slow for files with 700+ lines.
Would it be a way to not block the main thread?
I know it's slow for large files, but that doesn't affect how I'm using it. You're welcome to open a pull request with changes that make it more efficient, but I'm not sure that moving a very old issue from one repository to another is likely to get anything done.
Ok. I will try to fix it and submit a PR.
@ColdGrub1384 , did you fina a way to improve this situation? I also saw that the speed can be seriously impacted by the number and the type of regular expressions used for the highlighting
@NeomMob I'm not sure if this is relevant, but VSCode's editor stops parsing after a certain amount of lines. Maybe that could be used here?
EDIT VSCode stops parsing after 20MB or 300K lines
@nathfreder Thanks for your suggestion. We are not talking about this amount of lines. Here we can feel some speed issue after 1000 lines which is not that much/
@NeomMob I'm not sure if this is relevant, but VSCode's editor stops parsing after a certain amount of lines. Maybe that could be used here?
EDIT VSCode stops parsing after 20MB or 300K lines
I am having a JSON of 5 MB Somehow VS Code handling it very efficiently. Not Sure what they are doing.