lara-zeus / bolt

form builder for your users, with so many use cases
https://larazeus.com/bolt
MIT License
172 stars 31 forks source link

[Bug]: Performance Issue After Installing Bolt Package #281

Closed mohaphez closed 3 months ago

mohaphez commented 4 months ago

What happened?

After installing and integrating the Bolt package into our project and deploying it to the production environment, I noticed a significant decrease in system performance.

How to reproduce the bug

Investigation: After three days of thorough investigation, I discovered that the performance decline coincided with the installation of the Bolt package.

Testing: I conducted extensive tests, even on a clean project, where I solely installed the package without adding any additional code. I meticulously debugged the code line by line and benchmarked the system.

Observations: I observed that inserting the return true statement step by step in index.php, particularly after require __DIR__.'/../vendor/autoload.php';, significantly reduced system responsiveness. Furthermore, the issue intensified after$kernel = $app->make(Kernel::class);, indicating a failure to reach the original code.

Attached Benchmark: I've included an example benchmark, captured before and after the Bolt package installation on my local setup using Sail and PHP_CLI_SERVER_WORKERS=10 in .env

Before install Bolt Package: image

After installation Bolt Package: image


Request for Assistance: Despite extensive investigation, I'm unable to pinpoint the root cause of this issue. Any advice or insights would be greatly appreciated.

Thank you in advance for your assistance.

Package Version

3.0.38

PHP Version

8.2.10

Laravel Version

11.6.0

Which operating systems does with happen with?

Linux

Notes

No response

atmonshi commented 4 months ago

can you try to run the command php artisan icons:cache

RealMrHex commented 4 months ago

can you try to run the command php artisan icons:cache

Dear @atmonshi, I am wondering how and why this command must be run to improve performance, and why icons:cache affects loading and performance so significantly. It seems peculiar. Additionally, why is this not mentioned in the documentation? It took a week to debug and find the solution, but it appears that you were aware beforehand that this could happen and significantly affect performance

mohaphez commented 4 months ago

Thank you immensely for your prompt response.

Yes, he responded, and the issue has been resolved.

I'm genuinely overwhelmed; I almost want cry. :((

I've been grappling with this problem for three days.

Please ensure to highlight this part in bold in the README.

Thanks Again .

atmonshi commented 4 months ago

hey all :) trust me I understand the frustration you all going throw

so its been will known that filament already using blade icons (heroicons)

and it been mentioned in both filament and the main blade icon package.

so I always assume users will check these before blaming my plugins 😂. since my plugins depend on them.

I am glade the issues is resolved 👍 and PRs to the docs always welcome :)

RealMrHex commented 4 months ago

so I always assume users will check these before blaming my plugins 😂

sorry about that 😂😂😂

t.y BTW.

atmonshi commented 4 months ago

can you try to run the command php artisan icons:cache

Dear @atmonshi, I am wondering how and why this command must be run to improve performance, and why icons:cache affects loading and performance so significantly.

I wont go deep into this, but the idea for the blade icons is to load icons on demand, and you can install as many icons as you want, so imagine when calling heroicons-x laravel will try to find this file among maybe thousand of icons.

so cacheing is the solution! here is more details: https://github.com/blade-ui-kit/blade-icons?tab=readme-ov-file#caching

this is what we pay for extendibility and the ease of use vs performance :)

add this command to composer after each update and you're done :)