Open
Description
Forcing the hereDoc and nowDoc to syntax highlight if people don't want to use them is a little rough, considering it causes slowdowns on larger files.
After running syntime on a thousand line php file; the slow down, for these three ( javascript, sql, html ) to run, was around .24 seconds each per render. That is a whole second between key strokes.
https://github.com/shawncplus/phpcomplete.vim/blob/master/syntax/phpcompletetempbuffer.vim#L28-L39
Metadata
Assignees
Labels
No labels
Activity
Comment out the heredoc/nowdoc from the temp buffer syntax file for s…
complex857 commentedon Apr 13, 2018
Thank you for tracking this one down. I've tried to run the tests without them and things seem to pass. The only thing we used those to skip comments when we are looking for beginnings and ends of functions/classes but the normal comment area patterns would cover those, so I'd say it should be safe to merge.
Would you mind giving this issue-109 branch a try for a few days to see if i'm missing something?
cmtatro commentedon Apr 13, 2018
I checked out your branch with the items commented out, but no luck. I did see some speed improvement, but not the amount I was looking for. On a hunt to find out where else that regex is being called from
cmtatro commentedon Apr 13, 2018
So I found a workaround to my issue.
I am just going to clear the syn rule that is causing the issue.
:syn clear phpHereDoc
Thank you for trying to resolve the slow down.
complex857 commentedon Apr 14, 2018
Hmm, wait- now I'm confused 😊
The syntax file in this plugin is only used for hidden buffers the plugin uses to parse source code (mainly to find a function's opening / closing
{
}
pairs and to see if things are in comments and/or strings) and in general should only be a slow-down on typing when you either:The file you are actually editing shouldn't be affected by the syntax file in the repo, but the usual php syntax file you get with vim (or a third party) - correct me if I'm wrong here.
The file type the plugin has a syntax for is named
phpcompletetempbuffer
in hopes it won't collide with anything. If you check the valueb:current_syntax
and you see anything else then it shouldn't be related.cmtatro commentedon Apr 14, 2018