Comments (2)
We can also document some performance tips that Roact can't do on its own. One thing that I think has an effect but I've not had time to sit down and build a benchmark for is using named keys instead of the default numeric keys:
-- Write this:
{
Child1 = someElement,
Child2 = anotherElement
}
-- Not this:
{
someElement,
anotherElement
}
React recommends a similar practice when rendering lists: Lists and Keys
In Roact, the reconciler diffs children using their keys:
Lines 411 to 418 in bbb0663
If the key is determined by index, something as simple as inserting an element at the start of the list will change the index of every child, causing at least every child to be updated needlessly, or at worst causing every child to be torn down and re-rendered from scratch.
I don't know how much this actually matters in real-world applications, and I doubt it's noticeable outside of very, very large lists, but it's still a good practice.
from roact.
I'm building a benchmarking tool now due to increased internal pressure to get a better bearing on Roact's performance problems. A bunch of people are blocked on stuff being slow v.v
It's in another branch, I'll have a PR up either today or tomorrow.
from roact.
Related Issues (20)
- Roact Documentation for Installation is out of date
- Allow passing list of props to element props
- A way to use Roact with Roblox-TS(Typescript) HOT 3
- Function components HOT 1
- Add "ensureBinding" Function To Binding API
- Functional components HOT 1
- Error `Listeners can only be disconnected once` in context consumers
- Roblox
- Freeze props, freeze state after init
- Too much lag and errors on PC and iPad HOT 1
- why does createSignal not use the task library? HOT 1
- Wally publish could be automated with GitHub Actions HOT 2
- Allow Roact Bindings to skip property updates HOT 1
- PureComponent doesn't actually compare state
- SurfaceGUI not corretly detecting mouse events with Roact
- Build element from existing gui object suggestion HOT 1
- attempt to call missing method '__mount' of table
- [HELP] How to use "useSingleMotor" for rodux/reducer or store?
- Hola
- Roblox
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 roact.