Update request took so long (only for updating another field)

Is this normal behaviour that update requests took so long (up to 10s) only for updating / showing another field with no queries going on. I am using Core i3 10th gen with 8 GB ram and using Laravel octane to run the server. I've already cached the icons, run all optimization commands available and caching, disabling debugbar, but still taking too much for a simple update. is there any way to debug the bottleneck or optimize it?
No description
14 Replies
awcodes
awcodes4mo ago
There’s no way for any of us to answer this without seeing any code or what you are actually trying to do. We don’t have any insight to your server or the request.
fikurimax
fikurimaxOP4mo ago
Thanks for the response
awcodes
awcodes4mo ago
Do you have debug bar? At first glance I’m wondering if there’s an n+1 happening?
fikurimax
fikurimaxOP4mo ago
I do, but there's 0 queries The case is I want to update another field (calculate price) whenever i clicked a select option
awcodes
awcodes4mo ago
Nothing is immediately standing out to me that code wise would create slow responses from the filament side.
fikurimax
fikurimaxOP4mo ago
I see, I wonder if there's any process like middlewares or smth on the update request which makes it slow
awcodes
awcodes4mo ago
This is a big class though. Try removing things one at a time to try to isolate if any of the code is creating a bottleneck. It’s possible. Is this only happening on production or in local.?
fikurimax
fikurimaxOP4mo ago
both
awcodes
awcodes4mo ago
Ok. Then it’s definitely something in the code. I would remove fields one at a time to see where the slow down is. My guess is still an unoptimized db query. But that’s just a guess. If you can isolate it we can probably help more.
fikurimax
fikurimaxOP4mo ago
okay, maybe i should try that. Thank you, i'll update Hey @awcodes, thanks for your advice. I've tried to isolate each field to determine which one is the bottleneck, and I finally concluded that the problem is with the select option field that requires a third-party API call to populate the options. In my case, the select field is populating the options right after the previous select state is updated. Is there a way to start populating the options when I click the select field?
awcodes
awcodes4mo ago
Unfortunately not, if the options depend on an api call then you are at the mercy of their api.
fikurimax
fikurimaxOP4mo ago
I see, Alright then, thank you so much!
Dennis Koch
Dennis Koch4mo ago
Isn't that what searchable() does? Combined with ->->getSearchResultsUsing().
fikurimax
fikurimaxOP4mo ago
Oh? Never tried getSearchResultsUsing(), I'll try it
Want results from more Discord servers?
Add your server