rwth-acis / mobsos-evaluation-center

Web UI for collaborative success modeling
3 stars 1 forks source link

[BUG] Success modeling page become unresponsive #94

Closed lakhoune closed 2 years ago

lakhoune commented 2 years ago

Describe the bug The success modeling page become unresponsive on the first load of the page

To Reproduce

  1. Go to MobSOS EC
  2. Select a group (add one if there is none)
  3. Select a service
  4. At this point the page becomes very slow until all the charts are rendered which takes roughly 20s depending on the size of your success model

Additional context Make sure to load a success model large enough in size to experience this bug. This might be linked to yjs blocking the main thread since the same happens on the social bot frameworks page

lakhoune commented 2 years ago

The function _syncObjectToMap is very slow. For a large success model, it takes roughly 9 seconds to complete

lakhoune commented 2 years ago

The function _syncObjectToMap recursively calls itself to sync a simple object to yjs by deconstructing the object and transforming each subobject into ymaps that store primitive types. This is actually not necessary, as you can store whole objects in a map. I have pushed some changes that drastically reduce the execution time to around 8ms

lakhoune commented 2 years ago

Seems to be fixed for now. At least, even for large success models with 50 measures