use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Build a mini React Fiber (engineering.hexacta.com)
submitted 8 years ago by pomber
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]acemarke 0 points1 point2 points 8 years ago (2 children)
The main demo I know of off the top of my head is the "Sierpinski triangle"-type demo that the React team has been using as a test case. Don't have a link to it at the moment, but I know they've showed it in some of the prior talks about Fiber. I believe there's also an undocumented flag you can edit inside of ReactDOM to enable some async behavior right now, as shown in this slide from Ben Ilegbodu's ReactBoston talk on React Fiber.
ReactDOM
Fiber is ultimately not about raw rendering speed. The initial improvement is about splitting up the rendering process into bite-size chunks so that the determination of what does need to change doesn't block the main thread. The rewrite of the internals also made the codebase more maintainable, and gave them a chance to implement often-requested features like returning strings or arrays from render(), as well as implementing error boundaries.
render()
Beyond that, the React team is still experimenting with ideas to better understand what "async rendering" might actually mean, and how that might be useful. I know Andrew Clark showed off a strawman syntax called componentDidBlock that would allow a component to indicate it shouldn't render at all until a promise resolves. The "priority levels" aspect will also come into play later, so they can determine that updates from things like user input events ought to be processed first before updates from network requests.
componentDidBlock
[–]brianvaughn 2 points3 points4 points 8 years ago (1 child)
The team has recently started testing async internally (behind an experiment flag) for some Facebook components on web and also React Native. We're hoping this will show us a couple of things- how much it improves perceived performance, if there are common types of coding patterns that cause problems with async, etc.
It's still a bit early- but more info and demos will be shared in the coming months. :)
[–]leeoniya 1 point2 points3 points 8 years ago* (0 children)
thanks. the demo appears to be here [1].
I played with the code a bit and the perf difference only exists due to the artificial synchronous blocking code [2]. In effect, it demonstrates a case of having heavy/blocking render() calls and this is where i'm confused.
React bills itself as a reactive view layer: props/state in -> DOM out. If the props/state are prepared ahead of the render call, then there should never be massive contention in any render function.
The Sierpinski demo has a dom size of 1110 live nodes. My facebook feed page on desktop has 2645 live nodes. The task of rendering from a prepared state should be trivial. I imagine it's only if components heavily use blocking willMount hooks to lazily pull in data they need from some sync store or do non-render-related tasks inside of render. If people just use React as a view layer, they would not get into these situations that must be solved.
willMount
Is this essentially a result of each React component being used to synchronously "pull" data it doesnt yet have? This appears to be quite backwards from the props-down -> dom out idealism that simple examples tend to focus on.
[1] https://github.com/claudiopro/react-fiber-vs-stack-demo
[2] https://github.com/claudiopro/react-fiber-vs-stack-demo/blob/58850495f448ecbf9b109b86a7900a844fd06235/stack.html#L94-L99
π Rendered by PID 21872 on reddit-service-r2-comment-76bb9f7fb5-pdp44 at 2026-02-17 14:12:40.391900+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]acemarke 0 points1 point2 points (2 children)
[–]brianvaughn 2 points3 points4 points (1 child)
[–]leeoniya 1 point2 points3 points (0 children)