Dash_clientside.set_props 50 times slower than document.getElementById(id).innerText

Hello everyone,

I want to share an update on my recent decision-making process.

I’ve decided to embrace the concept of settling on a “good enough” solution rather than spending an indefinite amount of time chasing the “ideal” one.

In light of my main task’s specifications, I realized that there wouldn’t be more than 50 tasks per user at any given moment. To visualize this, I modeled a scenario with 50 tasks, each comprising 5 subtasks, being processed by 10 workers who keep the system updated on their progress.

I’ve integrated Dash’s .set_props callback from JavaScript to leverage all the benefits Dash offers. It appears that under these circumstances, I’m effectively utilizing nearly all of my desired capabilities:

  • The swift interface creation made possible by Dash
  • The robust handling of heavy tasks by queues
  • The rapid communication facilitated by websockets
  • The dynamic DOM manipulation enabled by JavaScript

Here’s a glimpse of the system in action, showcasing its efficiency:

Full process, but low quality (sorry about the resolution - max 4 mb are allowed to upload, it would be good to fix that in the future)

Screen Recording 2024-03-29 at 13.42.14

Part of video in better quality to feel the speed:
Screen Recording 2024-03-29 at 13.42.14

Good enough :slight_smile:

I’ve integrated tasks within Dash and established a separate function that checks worker results every 0.1 seconds. Progress and results are communicated to Dash via websockets, and if necessary, updates are made using set_props. A Dash callback, highlighted in green, signifies when the results are ready (triggered after set_props), ensuring that callbacks remain operational.

I’m quite pleased with the setup :blush:.

@jinnyzor, thank you for our insightful conversation. It helped me grasp several key concepts. I’m considering exploring AG Grid for this application in the future. However, at the moment, my mind is overwhelmed with a plethora of new information, so I want to give my brain a chance to “freeze” a little from all this new knowledge :slight_smile:

1 Like