F
Filament16mo ago
acarp20

Optimizing Filament test suite speed

As my application has grown and grown, I'm starting to notice how long my test suite takes to run. I'm also hunting down the cause of a memory leak somewhere... Currently in the tests/Feature/Filament folder I have 298 tests which have a total of 2049 assertions. I'm noticing a large bottleneck when filling forms which has to do with Livewire. Calling ->fill([...) sets each key/value pair individually causing the component to be rehydrated, when normally the bulk of these fields are deferred and therefore batched in one update. This means that any complex logic, queries, otherwise long closures, etc. that get run upon hydration are run for each property. When you have a large form with 20+ properties, this gets ridiculous. For the end user, it's not a problem as fields are deferred. I also don't think it makes sense to implement manual caching logic in the Livewire component just for ensuring tests are N times faster. It seems that perhaps the Livewire internals in v3 may make this possible. Does anyone have a solution here? Has anyone discovered any other optimizations?
1 Reply
niltonmelox
niltonmelox16mo ago
No idea
Want results from more Discord servers?
Add your server