-
Notifications
You must be signed in to change notification settings - Fork 185
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
Intellisense slow on 5k files #274
Comments
Hmm, aggregating the completion results should be O(n). |
Not sure if you saw this in the release notes of VSCode 1.9, but there is a php parser they are working on https://github.com/Microsoft/tolerant-php-parser Might be helpful in some way... |
Yes, I am aware of it 🙂 |
I have a similar issue on a Code igniter project. The autocompletion for class methods doesnt even pop up until I hit |
@autoferrit afaik the results are not cached, but only the files where we get the results right. I think that's the bottleneck, yes. |
CTRL + Space takes about 12 seconds for me. I do have 10k PHP files:
macOS: 10.13 |
Hi! @felixfbecker willing to work on this -- Do you have any suggestions on the best place to start? Profiling it with XDebug? |
Has anything help now? |
I had to switch to PHP Intelephense. |
@binarious is it faster? |
@lndj It just works for me. Suggestions and method signatures show up instantly on very large projects. |
@TheColorRed |
Same trouble, about 15 seconds, Yii2 basic project. And i switch to PHP Intelephense. |
I've also switched to Intelephense for now. Unfortunately Intelephense has it's own set of issues, but I can't live with autocomplete times of over 5 seconds in my project. I noticed @bmax didn't get any response to his offer to work on this in over 4 months. Can we expect this to be resolved at some point in the near future, or are we out of luck for the time being? |
@Vercoutere I ended up not putting any time into working on this because there happened to be a couple of other PR's started. I'm not sure why they haven't been merged. I have heard good things about Intelephense though. |
Is the slowness coming from this: CompletionProvider.php Lines 246-251 foreach ($this->index->getDefinitions() as $fqn => $def) {
foreach ($prefixes as $prefix) {
if (substr($fqn, 0, strlen($prefix)) === $prefix && $def->isMember) {
$list->items[] = CompletionItem::fromDefinition($def);
}
}
} There is no trie index or anything like that, but everything is always looped through and it filters the matching ones in the loop? |
Has there been any updates on fixing this? |
@felixfbecker Is it really neccessary to check each definition whether it starts with the prefix? Visual Studio Code is able to filter out, too? |
Same issue here... Takes up to 15 seconds on ctrl + space. Looking for a solution. |
A little discouraging that a few attempts have been made by community to fix this but not enough attention has been given to review it. The main purpose of this project is to assist developers in writing code faster. Unfortunately it fails at it right now due to these long standing performance problems. @felixfbecker, thank you for all your efforts! It's greatly appreciated, and I'm sorry to complain, but I felt like it's important to say this. |
Is anyone interested in bringing #599 over the finish line? |
I could do that, but only in two weeks(having a trip from tomorrow until next week). Hope someone else can do that earlier. :) |
We of the emacs-php community are eagerly awaiting this merge :) Thanks to everyone who put time into this PR! It's going to be big for the community |
Another member of the emacs-php community - just wanted to echo what @cmatzenbach said above! Thank you so much for all of your work! This is gonna make programming in PHP a much better experience in emacs. |
@felixfbecker I saw that the PR seems to be basically done. Is it possible somehow to test @jens1o's branch of php-language-server locally in vscode-php-intellisens? |
Yes, all you need to do is symlink your local language server repo clone into |
Thanks for the ping. Forgot to push. This is the current thing I've on. However, some tests are still failing currently. jens1o@f45c44f |
Feel free to open a work-in-progress PR |
It's getting parsed for me in less seconds but yeah doesn't change the fact it's slow in auto completing. Can't wait for a fix! |
@MichaelBelgium if you can't wait, help out :) |
Is this what needs to be done? |
Yes |
Okay, thanks for taking your time. :) |
Anytime :) if it's only a simple merge ... surprised nobody did it before me. |
Refactors Index into a tree structure, rather than an array of Fqns to definitions. Closes #274
🎉 This issue has been resolved in version 5.4.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This is released for VS Code in https://github.com/felixfbecker/vscode-php-intellisense/releases/tag/v2.3.6 🎉 I think this also included these other PRs: https://github.com/felixfbecker/php-language-server/pulls?q=is%3Apr+is%3Aopen+author%3ADeclspeck+sort%3Aupdated-desc |
Same, the issue is still happening, had to switch, now it's instant.. |
I like the new auto completion tool and, I have a Laravel project that parses the files like so:
When I type
$someVar->
it takes about 2 seconds until the suggestions show up.The text was updated successfully, but these errors were encountered: