You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/09/10 07:27:51 UTC
[GitHub] [echarts] JinJianQi opened a new issue, #17641: [Bug] setOption took a long time. And block UI process.
JinJianQi opened a new issue, #17641:
URL: https://github.com/apache/echarts/issues/17641
### Version
5.3.3
### Link to Minimal Reproduction
_No response_
### Steps to Reproduce
setOption took a long time.
I think maybe there are some diff process need to take some time. So, is there any way to send these merge processes to a worker?
### Current Behavior
setOption took maybe `30ms`. And block the UI process.
### Expected Behavior
setOption don't block the UI process.
### Environment
```markdown
- OS:
- Browser:
- Framework:
```
### Any additional comments?
_No response_
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] setOption took a long time. And block UI process. [echarts]
Posted by "nantunes (via GitHub)" <gi...@apache.org>.
nantunes commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-2371575370
https://github.com/apache/echarts/issues/17656 was also closed.
The open question is: is there a reason to clone?
I'm working with Apache Arrow data. Apache Arrow is a portable format for storing column-oriented data, allowing data to be shared as-is between various systems and language runtimes. It enables zero-copy query processing over large amounts of loaded data.
I'm trying to avoid pre-processing the data. I'm not expecting echarts to support arrow tables, but I'm able to use object proxies that translate between the two. But in the end everything is getting cloned, affecting both performance and memory.
[zrender's clone function](https://github.com/ecomfe/zrender/blob/247e11966657fb0fd3d92533e15e8b655bff3327/src/core/util.ts#L78) states "Instance of user defined class will be cloned to a plain object, without properties in prototype.". There is also no way to customise `BUILTIN_OBJECT`.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] JinJianQi commented on issue #17641: [Bug] setOption took a long time. And block UI process.
Posted by GitBox <gi...@apache.org>.
JinJianQi commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-1255987423
@Ovilia
In my case, I have a `treeShake` function. I would call this function when every time the `dataZoom` changed. I just cut off items out of window through `treeShake`. So, this function will be called frequently.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] Ovilia commented on issue #17641: [Bug] setOption took a long time. And block UI process.
Posted by GitBox <gi...@apache.org>.
Ovilia commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-1247828928
30ms is acceptable time and should not be noticable to users. Do you call `setOption` very frequently or what else cause the problem? You may provide a demo to show the case.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] echarts-bot[bot] commented on issue #17641: [Bug] setOption took a long time. And block UI process.
Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-1247829115
@JinJianQi Please provide a demo for the issue either with [Official Editor](https://echarts.apache.org/examples/editor.html), [CodePen](https://codepen.io/Ovilia/pen/dyYWXWM), [CodeSandbox](https://codesandbox.io/s/echarts-basic-example-template-mpfz1s) or [JSFiddle](https://jsfiddle.net/plainheart/e46ozpqj/7/).
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] setOption took a long time. And block UI process. [echarts]
Posted by "MindFreeze (via GitHub)" <gi...@apache.org>.
MindFreeze commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-2655687985
`clone` doesn't take that much time in my case but I found another major issue.
The chart rerenders fully for every `setOption` call. So even if you just want to enable `dataZoom`, change the tooltip formatter or even with just `setOption({})`, you get a full render. This can block the main thread for a long time when there is a lot of data.
This can be somewhat mitigated by checking the new options and skipping render in some cases.
Another improvement would be async rendering where echarts releases the main thread (with setTimeout, for example) during long renders. A `setTimeout` between rendering each series would be the most simple approach. Chunking all the data would be more comprehensive.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] setOption took a long time. And block UI process. [echarts]
Posted by "MindFreeze (via GitHub)" <gi...@apache.org>.
MindFreeze commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-2653286526
If you have a lot of charts on a page and they all update at the same time, it blocks for ~1s sometimes. Even if nothing is updated, just calling `chart.setOption({})` blocks the UI. `lazyUpdate` doesn't help either
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
[GitHub] [echarts] JinJianQi commented on issue #17641: [Bug] setOption took a long time. And block UI process.
Posted by GitBox <gi...@apache.org>.
JinJianQi commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-1255983079
@Ovilia Hi~
I find that when the value have a big object, the setOption will take longer time.
This is an Online demo to reproduce.
https://codesandbox.io/s/confident-shockley-2t1e7n?file=/src/index.js
<img width="1440" alt="image" src="https://user-images.githubusercontent.com/33452468/191929464-e525138c-a553-4e2c-bf4c-13c15e7715b2.png">
There is about 1000 x 50 values. And each item has a large `rawData`(it's a json object).
Something like this:
```
{
itemStyle: {},
value: [0, 10, 20, {...bigObject}]
}
```
Through the Performance tab of ChromeDevTool, I find the `clone` method of setOption take a long time. Like this:
<img width="1440" alt="image" src="https://user-images.githubusercontent.com/33452468/191930306-2cb7f71d-9326-41a4-a5d2-4e0b8dc28d32.png">
I think there must be some deepClone processes? Is there any way not to clone ?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] setOption took a long time. And block UI process. [echarts]
Posted by "kenjinz (via GitHub)" <gi...@apache.org>.
kenjinz commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-3435091789
> `clone` doesn't take that much time in my case but I found another major issue. The chart rerenders fully for every `setOption` call. So even if you just want to enable `dataZoom`, change the tooltip formatter or even with just `setOption({})`, you get a full render. This can block the main thread for a long time when there is a lot of data. This can be somewhat mitigated by checking the new options and skipping render in some cases. Another improvement would be async rendering where echarts releases the main thread (with setTimeout, for example) during long renders. A `setTimeout` between rendering each series would be the most simple approach. Chunking all the data would be more comprehensive.
It's exactly the same with my case where I have a huge amount of data and need to update the chart via setOption several time. In my case, after setting the series, it need around 3 - 4s to do 1 setOption even I just want to update the axis label or something else.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [I] [Bug] setOption took a long time. And block UI process. [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #17641:
URL: https://github.com/apache/echarts/issues/17641#issuecomment-2366964779
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org