dirslashls opened a new issue #13542:
URL: https://github.com/apache/incubator-echarts/issues/13542
### Version
5.0.0-beta.1
### Steps to reproduce
Take the basic line chart example and change it so that instead of one grid,
it renders multiple grids. Use the following code which creates 1000 grids. You
would notice that the rendering time is not linear with the number of grids.
For example, with 100 grids it renders within 200ms but setting it to 1000
grids changes to 14 to 18 seconds.
```
var grids = Array(1000).fill(null).map(() => {
return ({
});
});
var xAxis = grids.map((g,idx) => {
return ({
gridIndex: idx,
type: 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
})
});
var yAxis = grids.map((g,idx) => {
return ({
gridIndex: idx,
type: 'value',
})
});
var series = grids.map((g,idx) => {
return ({
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line'
});
});
option = {
grid: grids,
xAxis: xAxis,
yAxis: yAxis,
series: series
};
```
### What is expected?
The rendering performance should be linear with the number of grids.
### What is actually happening?
It seems to be O(n^2) or worse.
---
When I profiled it in chrome it showed the the method isAxisUsedInTheGrid
seems to consume maximum time.
Note that while in the above example all the grids occupy the same space, in
my actual use case they don't overlap. I provided the unrealistic example just
to point out the performance when there are many grids.
<!-- This issue is generated by echarts-issue-helper. DO NOT REMOVE -->
<!-- This issue is in English. DO NOT REMOVE -->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]