Improve loading of components with lots of data
See original GitHub issue#174 / #177 fixes the load time of the devtools. This means we’ve closed #10 but we still get performance issues, localised to loading of component data.
This is an umbrella issue for 2 things we’re seeing after the above, for components with large $data
eg. https://alpinetoolbox.com, the main “div” component:
- loading the component data can take a while (“get-data”, “set-data”)
- toggling attributes is sluggish
We still need to pinpoint where exactly the bottlenecks are, candidates:
- preparing of the data for serialization (we traverse the data and generate a data structure for the panel)
JSON.stringify
(the actual serialization might be costly for whatever reason)- sending a large string from the
backend
to theproxy
to theapp
tostate
to thedevtools
(panel) - rendering the data in the panel with Alpine
Current ideas to fix bottlenecks (depending on where they are):
- the stringification/serialization and parse/deserialization operations might be costly -> switch to a faster implementation, probably a library
- making serialization an async process so it yields the event loop for execution of other operations (would keep the page/devtools more interactive)
- reduce the size of the message by
- changing the schema (eg. removing unused fields)
- encoding it (Lempel Ziv? encoding performance would have to be weighed against the cost of a larger payload)
- Alpine.js rendering optimisations, eg.
x-show
vsx-if
, addingkey
tox-for
’s
Notes
Ryan found this for profiling extensions https://gist.github.com/bvaughn/ab6a6aefcda21dd2db69c7eaa7bf3332
It’s probably worth adding a “load test”/“benchmark” Cypress example based on alpinetoolbox.com data.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
Five Data-Loading Patterns To Boost Web Performance
You don't need a framework for everything, but if you use one, this article will help you use it in the most performant...
Read more >How To Speed Up Data Heavy React Components
Simple Technique To Boost Performance Every time state is updated, the component is rendered. By default, React thinks every component render ...
Read more >How to Optimize Components to Improve React Performance
In this tutorial, you will learn how to maximize React performance by measuring rendering bottlenecks and optimizing your components.
Read more >Use lazy loading to improve loading speed - web.dev
This post explains lazy loading and why you might want to lazy-load elements on your site.
Read more >9 Quick Ways to Improve Page Loading Speed - HubSpot Blog
1. Choose a performance-optimized hosting solution. · 2. Compress and optimize your images. · 3. Reduce your redirects. · 4. Cache your web...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Left two potential optimizations here that i don’t think affect anything negatively but greatly improve responsiveness in my testing.
https://github.com/alpine-collective/alpinejs-devtools/pull/177#discussion_r593522339
Yeah I agree we’re pretty good for now.