question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’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?

image

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Tarmilcommented, Nov 4, 2019

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 with ecomp (see #87) with the released package, but it’s fixed on master and I’ll do a release soon 🙂

1reaction
OnurGumuscommented, Nov 4, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found