barryvdh / laravel-ide-helper

IDE Helper for Laravel
MIT License
14.17k stars 1.16k forks source link

Latest commit causes massive slowdown on writing to models #1291

Closed jonnywilliamson closed 2 years ago

jonnywilliamson commented 2 years ago

Versions:

Description:

Using the absolute latest commit of this package this evening when wanting to test out the new support for attributes in 8.77 (https://github.com/barryvdh/laravel-ide-helper/pull/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.

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

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

mfn commented 2 years ago

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

barryvdh commented 2 years ago

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