Skip to content

Latest commit causes massive slowdown on writing to models #1291

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

Closed
jonnywilliamson opened this issue Jan 3, 2022 · 2 comments · Fixed by #1292
Closed

Latest commit causes massive slowdown on writing to models #1291

jonnywilliamson opened this issue Jan 3, 2022 · 2 comments · Fixed by #1292
Labels

Comments

@jonnywilliamson
Copy link

Versions:

  • ide-helper Version: last commit #29dd57e1e27540cefea914500fc6cca3ee33dbed
  • Laravel Version: 8.77.1
  • PHP Version: 8.0

Description:

Using the absolute latest commit of this package this evening when wanting to test out the new support for attributes in 8.77 (#1289), I noticed that the generation/writting to the models was SO much slower than it ever has been in the past.

I checked out multiple commits and the only one to show this issue was the one commited today (#29dd57e1e27540cefea914500fc6cca3ee33dbed)

I took a video to show the difference. Normally I'd speed up the video but in this case it makes more sense to let it run in real time. This is what I did.

  • I installed the SECOND most recent commit (#6244a931a00ee313a7081a86d217fbb8e48c7aad) in my project.
  • As part of my composer.json post-update-cmd is the following command
        "post-update-cmd": [
             <snip>
            "@php artisan ide-helper:models --smart-reset --phpstorm-noinspections --write",
             <snip>
        ],

Just after that gets installed you can see it writting new docblocks to all my models. It takes less than a second and whizzes through.

  • Then I install the latest commit (#29dd57e1e27540cefea914500fc6cca3ee33dbed).
  • Watch how it takes nearly 30secs to go through all the models.

Something in the latest commit with the new attribute support is causing a lareg slow down but I don't know where or how to debug why it's taking so much time.

I hope the video helps explain it better! It's about a minute long.

Thank you!

https://youtu.be/c8elNXVuEiA

@jonnywilliamson jonnywilliamson changed the title Latest commit causes massive slowdown on generating ide_ Latest commit causes massive slowdown on writing to models Jan 3, 2022
@mfn
Copy link
Collaborator

mfn commented Jan 3, 2022

Thanks for the report, I can confirm this and creating a PR to improve this, please see #1292

@barryvdh
Copy link
Owner

barryvdh commented Jan 3, 2022

Thanks for spotting this and the clear report to narrow it down! And thanks for fixing it so quickly @mfn

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

Successfully merging a pull request may close this issue.

3 participants