F
Filament11mo ago
Harvey

Are table actions slow?

I am migrating a website from Nova to Filament and I was just comparing the page load times. I understand Nova is Vue and uses ajax(inertia), but a pure livewire table is very quick. I have a table with 25 rows and 1 column, and when I add view, edit and delete iconButtons it slows by 350ms... I have run php artisan icons:cache with no difference. Not sure why it's slowing down so much, is blade rendering just slow with this many views?
Solution:
Telescope was the main cause. Have it enabled on dev, and disabling it halved the response times. Likely because telescope also watched blade views. Just like debugbar...
Jump to solution
10 Replies
Harvey
HarveyOP11mo ago
return $table
->query(Job::query())
->defaultSort('created_at', 'desc')
->columns([
TextColumn::make('external_reference')
->searchable()
->label('Your reference'),
->actions([
ViewAction::make('View')
->iconButton(),
EditAction::make('Edit')
->form(JobResource::getEditFormFields())
->iconButton(),
DeleteAction::make()
->iconButton(),
])
->bulkActions([
// ...
])
->defaultPaginationPageOption(25);
return $table
->query(Job::query())
->defaultSort('created_at', 'desc')
->columns([
TextColumn::make('external_reference')
->searchable()
->label('Your reference'),
->actions([
ViewAction::make('View')
->iconButton(),
EditAction::make('Edit')
->form(JobResource::getEditFormFields())
->iconButton(),
DeleteAction::make()
->iconButton(),
])
->bulkActions([
// ...
])
->defaultPaginationPageOption(25);
The eloquent query takes ~1ms to run
Dennis Koch
Dennis Koch10mo ago
Can you share the JobResource::getEditFormFields() part?
Harvey
HarveyOP10mo ago
TextInput::make('external_reference')
->label('Your reference')
->required(),
Select::make('handler_id')
->label('Handler')
->options(fn () => User::all()->pluck('name', 'id'))
->columnSpanFull()
->searchable()
->required(),
Textarea::make('notes'),
TextInput::make('external_reference')
->label('Your reference')
->required(),
Select::make('handler_id')
->label('Handler')
->options(fn () => User::all()->pluck('name', 'id'))
->columnSpanFull()
->searchable()
->required(),
Textarea::make('notes'),
Dennis Koch
Dennis Koch10mo ago
I wouldn't recommend fetching all users as options: ->options(fn () => User::all()->pluck('name', 'id')) you can use getSearchResultsUsing() (I think). But shouldn't be that much of a difference 🤔
Harvey
HarveyOP10mo ago
Yeah not much changed What's strange is when I add actions in 1 by 1, the ms increase is quite large like an extra 200-400ms just by adding the DeleteAction (with icons cached)
Dennis Koch
Dennis Koch10mo ago
Hm. That sounds weird.
Harvey
HarveyOP10mo ago
Yeah I think my project is just slow overall. Setup a new laravel project and it's way faster. I still have Nova installed in the same project, could that be causing a slow down?
Dennis Koch
Dennis Koch10mo ago
Not sure.
Harvey
HarveyOP10mo ago
Alrighty, thanks for your help😄 . Think I'm just going to have to strip things back to try figure out what's causing this for my specific case.
Solution
Harvey
Harvey10mo ago
Telescope was the main cause. Have it enabled on dev, and disabling it halved the response times. Likely because telescope also watched blade views. Just like debugbar...
Want results from more Discord servers?
Add your server