Skip to content
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

2.0.11 is scanning every single file while 2.0.8 is not #9760

Closed
michabbb opened this issue Mar 6, 2021 · 11 comments
Closed

2.0.11 is scanning every single file while 2.0.8 is not #9760

michabbb opened this issue Mar 6, 2021 · 11 comments
Labels
Milestone

Comments

@michabbb
Copy link

michabbb commented Mar 6, 2021

hi,

i don´t really understand why. when running "-vvv -h" i can see with a strace, that 2.0.11 is scanning "every single file" in my project while showing this:

Reading /home/myproject/vendor/composer/installed.json

while 2.0.8 is NOT.

so a simple "-h" takes:

2.0.8: 17 seconds
2.0.11: 2 minutes and 45 seconds
1.10.20: 11 seconds (btw)

is there a major change between these versions i have missed ?
i should mention: i am running composer via docker (Linux).

update: 2.0.9 behaves like 2.0.11 -> scanning every single file 😕

@Seldaek
Copy link
Member

Seldaek commented Mar 7, 2021

Not sure what you mean by "scanning", and definitely can not reproduce such slowness.. Also running -vvv -h does not mean anything, which command are you running exactly? Please provide full command and full output..

Here is the full changelog for 2.0.9 as that seems to contain the cause it's relevant 2.0.8...2.0.9 - but hard to pinpoint it any further given the lack of info here.

@Seldaek Seldaek added this to the 2.0 milestone Mar 7, 2021
@Seldaek Seldaek added the Bug label Mar 7, 2021
@michabbb
Copy link
Author

michabbb commented Mar 7, 2021

i am running "composer -h -vvv" nothing more. i am running it inside a project with many files and lot installed packages. while watching with strace i can see that composer is reading, opening, scanning, touching - however you want to call it, "every single PHP file" of my project, while 2.0.8 is not. that's reproducible for me - i am not able to identify the single commit out of 76 which might cause this, that´s why i wrote here in hope, someone has a clue....

@Seldaek
Copy link
Member

Seldaek commented Mar 7, 2021

Can you try with composer -h -vvv --no-plugins see if that does it too?

@Seldaek
Copy link
Member

Seldaek commented Mar 7, 2021

And for the record, for me this runs in 0.1sec so already your 17 seconds on 2.0.8 seems insanely slow.

@michabbb
Copy link
Author

michabbb commented Mar 7, 2021

when u are a windows user who is using vmware to have a real linux and using a shared mount for your code to see that inside your Linux, you are doomed anyway.. so reading many small files is bad as hell anyway... we don´t have to discuss who stupid that is, but it has nothing to do with the fact, that every composer version above 2.0.8 is touching, opening, reading, scanning every single file inside my project. maybe that is wanted, maybe not, i don´t know. but for everybody who is dealing with shared mounts, that is pure horror. so i am trying to find out, if this is intended or wanted because of some reasons i don´t understand, or if that is not intended and more seen as a bug.

@michabbb
Copy link
Author

michabbb commented Mar 7, 2021

with --no-plugins everything is fine, thanks for letting me know, didn´t know that flag. is there any chance to disable each plugin individually so that I'm able to find out, which plugin is causing this scanning?

@michabbb
Copy link
Author

michabbb commented Mar 7, 2021

so when using -vvv i see this:

Reading ./composer.json (/home/myproject/composer.json)
Loading config file /root/.composer/config.json
Loading config file /root/.composer/auth.json
Loading config file ./composer.json (/home/myproject/composer.json)
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/home/myproject): git branch -a --no-color --no-abbrev -v
Reading /root/.composer/composer.json
Loading config file /root/.composer/config.json
Loading config file /root/.composer/auth.json
Loading config file /root/.composer/composer.json (/root/.composer/composer.json)
Loading config file /root/.composer/auth.json
Reading /root/.composer/auth.json
Reading /home/myproject/vendor/composer/installed.json
Loading plugin UpdateHelper\ComposerPlugin

as soon composer prints

Reading /home/myproject/vendor/composer/installed.json

that´s the point in time where scanning all of my files begins....

i don´t really know where UpdateHelper\ComposerPlugin is coming from 🤔

@michabbb
Copy link
Author

michabbb commented Mar 7, 2021

@Seldaek your hint with --no-plugins helped me to solve my problem, 1000 thanks !!!
so it´s not docker itself, it´s this plugin that is scanning all my files, don´t know why, but at least i finally know how to stop it.

thanks a lot !

@Seldaek
Copy link
Member

Seldaek commented Mar 9, 2021

Just to reply to:

when u are a windows user who is using vmware to have a real linux and using a shared mount for your code to see that inside your Linux, you are doomed anyway..

IMO that's not a necessity anymore.. I use Windows + WSL2 and run stuff natively on Linux there, all code is in WSL and everything runs very fast. The only catch is it slows down the editor a little if you run the editor on the Windows side of things.

@michabbb
Copy link
Author

michabbb commented Mar 9, 2021

Just to reply to:

when u are a windows user who is using vmware to have a real linux and using a shared mount for your code to see that inside your Linux, you are doomed anyway..

IMO that's not a necessity anymore.. I use Windows + WSL2 and run stuff natively on Linux there, all code is in WSL and everything runs very fast. The only catch is it slows down the editor a little if you run the editor on the Windows side of things.

I went through all of that, there is always something that is not working or ruins your day. phpstorm does not support docker 100% remote, they still live in that world where everything is local host (plenty of discussions I had with them about that)... either the tools inside your vm are running smooth or your windows tools, but never both, when dealing with hundrest (or thousands) little files, as said, pure horror. it doesn't play a role if you use vmware shares or wsl2 shares, share is share, and as long there is no nativ access from windows side to a Unix file system without any extra layer between, windows users will always have to deal with a downside, doesn't matter on which side.

this issue here reminded me painfully.
but, since phpstorm does not support docker remote (fully remote) anyway, I created myself a vm with Ubuntu, KDE and phpstorm inside. that's the only thing that really works as a windows user, without dealing with plenty of hacks 😞

for instance: my windows backup software is not able to mount or access a wsl2 path, so I would need to run samba inside my vm only to be able to backup that files, the whole concept with wsl2 made progress in the last years, but if everybody is honest to himself, being a windows user in a php world is a pain in the.... 😞

and there are plenty more examples...

@Seldaek
Copy link
Member

Seldaek commented Mar 9, 2021

As far as I can tell, PhpStorm added WSL2 support in 2020.2 or something.. And 2021.1 EAP seems to also fix a few more things, so there's hope :) Anyway for me that work way better/smoother than having the overhead of a VM.

And FWIW regarding WSL2 backups, I use SyncBackPro which does support reading directly into \\wsl$\Ubuntu-20.04\...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants