Maxikilliane / DH_MusicAnalysis

0 stars 0 forks source link

Prevent too much workload on synchronous XMLhttprequest #67

Open blueCat11 opened 5 years ago

blueCat11 commented 5 years ago

On localhost we simply get a warning like this: "Synchrone XMLHttpRequests am Haupt-Thread sollte nicht mehr verwendet werden, weil es nachteilige Effekte für das Erlebnis der Endbenutzer hat. Für weitere Hilfe siehe http://xhr.spec.whatwg.org/" But on the deployed version, workers are timed out after a set time, and then our music does not render at all. This is for individual analysis. In the case of distant hearing: A similiar problem arises also leading to a timeout in the deployed version, when the analysis takes too long in the backend.

We need to find away around the synchronous property of those requests, a way to manipulate the DOM asynchronously.

blueCat11 commented 5 years ago

The results of my investigations for individual analysis:

blueCat11 commented 5 years ago

Distant Hearing is a bit different, since here the problem is not on the frontend, as for individual analysis, but on the backend. I am more optimistic about that.

blueCat11 commented 5 years ago

I've just tested the distant hearing workaround in deployment. Unfortunately, we still get errors, because of time-out. Probably we are still doing too much work in the frontend, generating all those graphs... We should:

  1. reduce the amount of calculations in the front-end (use groups stats provided by backend)
  2. maybe use webworkers to asynchronize generation of stats.
blueCat11 commented 5 years ago

Probably we also need to optimize the backend - keyword: parallel loops ( map-reduce?)