pissang commented on pull request #13314:
URL:
https://github.com/apache/incubator-echarts/pull/13314#issuecomment-695911751
> i've tried feeding typed arrays to uPlot in the past and surprisingly did
not measure a difference in performance. i'll take a closer look in a few days
at your improvement to the uPlot bench, but i was surprised that typed arrays
made a significant difference for you. maybe i should look into it again.
Perhaps it's because echarts use a different data structure that has worse
performance than uplot when using a normal array.
I noticed the data structure used in uplot is
```js
[
[........], // x dimension
[........], // y dimension
[........] // z dimension
]
```
It's much flatter than the structure echarts used.
```js
[
[x, y, z],
[x, y, z],
[x, y, z]
]
```
Which may need less heap memory and have much less GC pressure. Using
TypedArray in echarts is mainly for getting away long GC time. I tested
read/write of TypedArray, it has no big difference than a normal array.
> out of curiosity, does echarts handle data gaps by default or is this an
additional setting? in uPlot the null-testing per-datapoint adds ~20% overhead
to the bench in both, dataset min/max finding as well as path drawing. i
decided it was an okay trade-off instead of bloating the code and maintaining
slightly different dedicated loops for gap-less data.
echarts handles null data by default. Haven't tested how much time can be
saved if we remove the null testing. But I guess it should not the bottleneck
for echarts currently.
----------------------------------------------------------------
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]