Comments (1)
BTW, this article is amazingly clear and useful : https://webperf.tips/tip/layout-thrashing/
Layout Thrashing and Forced Reflows
The browser's style and layout process (also known as reflow) is responsible for assigning visual styles and geometry to elements of a web application. It is one of the most expensive computational operations performed during the lifecycle of a web application, yet many web developers introduce code that forces it to run more often than it needs to!
When JavaScript codepaths force the browser to perform the reflow process outside of its usual cadence, it's called a forced reflow. When codepaths perform a forced reflow multiple times in quick succession within a frame, it's known as layout thrashing.
In this tip, we'll discuss forced reflows, layout thrashing, how to spot it in your application, as well as techniques for mitigating the performance impact.
Next, I'll quote some advice that probably transfers to Dioxus:
React Development
By using React you are not protected from Layout Thrashing. All web applications can abuse the browser's layout engine, even those written in modern web frameworks.
React's declarative syntax adds a layer of indirection into when the actual DOM mutations (and Layout invalidations) occur. This can make spotting Layout Thrashing harder when reading through code.
In my experience, Layout Thrashing occurs in useEffect hooks trying to measure DOM nodes or other React components. Typical use cases for performing this type of measuring include positioning a Tooltip or restoring Scroll Position.
from dioxus.
Related Issues (20)
- `dx serve` panic: Could not receive a socket - the devtools could not boot - the port is likely already in use HOT 2
- Client-side error only in release mode on 0.6.0-alpha.2: Uncaught TypeError: root is undefined / Cannot read properties of undefined (reading 'appendChild') HOT 2
- dx serve a desktop project panics on latest git version
- Link href does not include the config's `base_path`.
- Consider automatically configuring `server_fn`'s server url using the `base_path` from `Dioxus.toml`
- Better document limitations of file pickers in liveview
- `use_branched_signal` Hook to convert from `ReadOnlySignal` to `Signal` HOT 2
- External component breaks fullstack with custom Tokio/Axum HOT 6
- `dx bundle` panics for Desktop on Windows HOT 3
- Add lints for hooks in conditional branches (`&&` + `||`)
- `dx bundle` does not work.
- Fullstack example auth is panicking HOT 2
- R
- Dropping files (`ondrop`) doesn't work on Windows HOT 3
- Destructuring tuples panics #[component] macro HOT 2
- Support for the `onclose` event handler
- `launch` should not be in prelude and `LaunchBuilder` and associated configs need to be reworked
- Implement module namespacing in `routable` derive macro HOT 1
- Importing file_engine feature does not allow the use of files() method in FormData
- The new syntax does not allow you to create an initial state without violating the hook creation rules HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dioxus.