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/15 16:06:17 UTC

[GitHub] [echarts] JakubRaban opened a new issue, #17656: `setOption` takes most of the execution time in `clone` function

JakubRaban opened a new issue, #17656:
URL: https://github.com/apache/echarts/issues/17656

   ### Version
   
   5.3.3
   
   ### Link to Minimal Reproduction
   
   _No response_
   
   ### Steps to Reproduce
   
   Create a line chart with a few series and animations turned off which is periodically updated (in my example every 100ms) using `setOption` function by supplying the entire history of data for the visible period of time:
   ```
   chart.setOption({
     series: dataHistoryForAllSeries.map(dp => ({ data: dp }))
   })
   ```
   Every series has around 100 000 data points
   
   ### Current Behavior
   
   Recently I created a demo app to check whether echarts would fit my team's use case. In our application we have multiple history graphs with varying time intervals which are first pre-filled with historical data and then updated with varying frequency, sometimes as often as every 100ms. I do it similarly to what [examples](https://echarts.apache.org/examples/en/editor.html?c=doc-example%2Ftutorial-dynamic-data) show (that is, old data is removed, new data is pushed and entire array is supplied to `series.data` in `setOption`). When profiling the app, I realized that a big part of `setOption`'s execution time is spent on cloning (function called `clone`). The rest seems like a small part compared to that. I'd like to know whether data could be passed in another way in which the performance would be hurt less, or whether it's something that could be improved on your side.
   
   Analysing one of the function calls from the screenshot below:
   - total `setOption` execution time: 107.93 ms
   - approximate time spent in some cloning function: 54.26 ms
   ![image](https://user-images.githubusercontent.com/21955777/190450241-ef080235-23fa-44f6-b93d-a67166274526.png)
   
   ### Expected Behavior
   
   Reduction of `setOption` execution time
   
   ### Environment
   
   ```markdown
   - OS: Fedora Linux 35
   - Browser: Chrome 103
   - Framework: Angular
   ```
   
   
   ### 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