Over the years, the Filament team has done a lot of work behind the scenes to make Filament the fastest, most performant option available for building your applications in the TALL stack. Most recently, they did a huge rework of the tables package that massively decreased render time in the v3 to v4 upgrade.
Well, over the past few months, they've been back at it again trying to squeeze some more performance out of Filament. This time, they've made a bunch of adjustments across the entire first-party Filament package ecosystem, and are excited about the preliminary performance gains they are seeing in their testing!
However, before the team launches a release this big to all Filament applications everywhere, they want to make sure that they give these changes time to be used in real-world applications. To do this, the team is launching all of these changes with a new beta version of both Filament v4 and v5 that you can install into your Filament applications today! All they ask is that you keep them up to date with any issues you bump into locally as well as giving them feedback into how much of a performance improvement you see in your specific use case.
Installation instructions
You can get up and running with either the v4 or v5 beta in just a few simple steps:
- Update your
composer.jsonconstraints for any open sourcefilament/*package to either^4.12@betaor^5.7@betadepending on which major version of Filament you are currently running - Run
composer updateto pull the latest beta version - $$$
Just like that, without any major code changes, you should be up and running with a more performant version of Filament.
As always, this is the part where I add my usual disclaimer about not using these beta versions in production. They are, by nature, potentially unstable, so be cautious as to where you use these beta versions! However, they are perfectly fine to run locally or in a staging environment.
Please add a reply to this GitHub discussion so we can get a gauge on how many people have tested the beta whether you experience issues with the beta or not. We need to know that it's working well with no issues just as much as we need to know of any bugs!
What changed?
If you are curious as to what has changed to give Filament such a performance boost, here are a few of the stand-out adjustments that we've made across the ecosystem:
Forms & schemas
- Significantly faster rendering of large forms, thanks to refactoring Blade views into simple HTML generation functions.
- Repeaters, builders, and repeatable entries now memoize their internal child schemas more aggressively.
- Component configuration, colours, descriptions, icons, and tooltips are now memoized.
- Selects resolve their options fewer times while rendering in some situations.
Tables
- Faster overall table rendering, including optimised rendering fast-paths for basic text columns and actions, alongside and various other internal memoizations.
- State formatting runs fewer times per cell in some cases.
- Optimised table reordering for BelongsToMany relationships.
- Internal parts of the query builder are now memoized rather than rebuilt repeatedly.
Panels & resources
- Memoized model-to-resource lookups, resource slugs, resource page names, and relation manager visibility.
- Faster navigation group sorting.
Widgets & charts
- Stat chart widgets no longer import the entire Chart.js library, reducing bundle size.
- Stat charts no longer redraw when the underlying data hasn't changed.
Other
- A more efficient ComponentAttributeBag that replaces Laravel's.
- Fixed a memory leak caused by action modal event listeners not being cleaned up.
- Fewer redundant config fetches and button component instantiations across requests.
- More efficient filesystem disk caching and file-existence checks.
- Notification Alpine components now serialise less data.
A huge thank you
I know the Filament team says this in practically all of our blog posts, but we truly can't say it enough: Filament wouldn't be the incredible ecosystem it is today without all of you in the community.
From the bottom of our heart, thank you for getting us here, and thank you even more for being willing to help us test these new versions of Filament to benefit everyone throughout the entire community.
Let's make Filament even faster, together!
P.S. Please remember to reach out in this GitHub discussion if you test the beta versions, even if they work fine!
Senior Software Development Engineer @ Zillow. Head of Developer Relations @ Filament. Mentor. Loves Laravel, Filament, JS , and Tailwind. Vim user. Has a cute corgi. Posts at https://alexandersix.com