elastic-charts icon indicating copy to clipboard operation
elastic-charts copied to clipboard

Performance: Layered time axis takes a long time on initial render

Open flash1293 opened this issue 3 years ago • 0 comments

Describe the issue When using the layered time axis with a lot of series, the first render is relatively slow because a lot of time is spent in the multilayerAxisEntry function. Subsequent renders don't seem to suffer from this.

To Reproduce

Go to https://codesandbox.io/s/flamboyant-chaum-v6fj7?file=/src/App.tsx and hit the "Show" button. Performance profile shows it's spending > 100 ms in this function: Screenshot 2022-02-10 at 10 57 20

This doesn't happen on subsequent calls, only initially

Expected behaviour Not sure whether this is an issue or not as it's only happening once and seems to be cached effectively after that.

Additional context The number of data points does not affect the timing

flash1293 avatar Feb 10 '22 10:02 flash1293