Over the years, we've 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, we did a huge rework of our tables package that massively decreased render time in the v3 to v4 upgrade.
Well, over the past few months, we've been back at it again trying to squeeze some more performance out of Filament. This time, we've made a bunch of adjustments across the entire first-party Filament package ecosystem, and we're excited about the preliminary performance gains we're seeing in our testing!
However, before we launch a release this big to all Filament applications everywhere, we want to make sure that we give these changes time to be used in real-world applications. To do this, we are 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 we ask is that you keep us up to date with any issues you bump into locally as well as giving us feedback into how much of a performance improvement you see in your specific use case. Please also keep us informed if you do not experience any issues, as that will get us closer to being able to release them! We created this GitHub discussion for feedback.
#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 if you experience issues with these beta versions or not. Please reply either way, otherwise we don't know if anyone has tested them!
#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
BelongsToManyrelationships. - 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
ComponentAttributeBagthat 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 we say 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!