medusa-ui/diff-engine

Performance improvement

Opened this issue · 1 comments

Based on tracing with Jaeger:

The weakest point is clearly the DiffEngine.
An action call can easily take 125ms to re-render. But the rendering itself only takes microseconds, so Thymeleaf itself is incredibly efficient. What takes times is the diffing.
so of the 125ms, 106 ms is (84%):

  • 58ms = HTMLLayerBuildupEngineLogic.recursive()
  • 48ms = HTMLLayerBuildupEngineLogic.initialParse()
    We then lose a little bit more time at Engine.calculateForLayer, up to 10ms total (8%).

button-click-flamegraph
button-click-timeline

I have made one potential performance improvement and released it as 0.0.6

button-click-improvement