Slow rendering
See original GitHub issueI’m trying to implement a simple logic game in F#/Bolero. Game board is represented by a 30 * 30 html table. Table cells can have background and/or single char in them, nothing fancy.
Source: https://github.com/ptupitsyn/klopodavka-fs Try it: https://klopodavka.netlify.com/ (click on cells with dots in them)
Clicking on a valid cell changes it’s state. Handling the click takes ~35 ms on i7-9700k, which is tolerable, but on older hardware and on mobile it can take over a second, which is unusable.
- I tried profiling in Chrome, but the whole call tree consists of
wasm-function
- I am sure it is the Bolero rendering, not the underlying game logic - if I render 5 rows of 30, it is ~6 times faster
I am new to F# and Bolero, so questions are:
- Am I doing something wrong?
- Is it possible to profile and see actual function names?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Slow rendering | App quality
If your app suffers from slow UI rendering, then the system is forced to skip frames and the user perceives stuttering in your...
Read more >7 Hidden Reasons on Why Does Rendering Take So Long
#1 - Lower Computer Configuration · One of the most popular reasons for long rendering is the low computer specification. For example, you...
Read more >How to fix Slow Rendering (Android vitals)
To render each view, Android goes through three stages: 1.measure. 2.layout ... Try these steps to figure out the GPU rendering issues.
Read more >Learn about screen rendering performance data (Apple ...
Slow rendering frames — Measures the percentage of screen instances that take ... Slow or frozen frames in your application might result in...
Read more >RENDER SPEED PROBLEMS, RENDER CRASHES, AND ...
When a system is not rendering as fast as expected it can be due to many ... Otherwise (if it is only slow...
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
Yes, you should wrap them in a component and override
this.ShouldRender(oldModel, newModel)
to ensure that it doesn’t get re-rendered unnecessarily.Also, collections of items like this should use the
key
attribute to help the renderer. Unfortunately this is not possible yet withecomp
(see #87) with the released package, but it’s fixed on master and I’ll do a release soon 🙂@ptupitsyn Perhaps you can wrap each td into an elmish component and control the rendering. Because it seams you are rerendering 900 cells for each click which is an ouch! It is documented in bolero docs how to wrap it to an elmish component.