Sourceful icon indicating copy to clipboard operation
Sourceful copied to clipboard

Very slow for large files

Open ColdGrub1384 opened this issue 5 years ago • 7 comments

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.

ColdGrub1384 avatar Jun 01 '19 12:06 ColdGrub1384

Would it be a way to not block the main thread?

ColdGrub1384 avatar Jun 01 '19 12:06 ColdGrub1384

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.

twostraws avatar Jun 01 '19 12:06 twostraws

Ok. I will try to fix it and submit a PR.

ColdGrub1384 avatar Jun 01 '19 12:06 ColdGrub1384

@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 avatar Jun 19 '19 12:06 NeomMob

@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 avatar Jul 05 '19 23:07 nathfreder

@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 avatar Jul 15 '19 13:07 NeomMob

@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.

varkrishna avatar Apr 13 '24 13:04 varkrishna