elastic-charts
elastic-charts copied to clipboard
Performance: Layered time axis takes a long time on initial render
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:

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