Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataZoom type inside bring unnecessary slow rendering in large data. #15409

Closed
100pah opened this issue Jul 24, 2021 · 3 comments
Closed

dataZoom type inside bring unnecessary slow rendering in large data. #15409

100pah opened this issue Jul 24, 2021 · 3 comments
Labels
bug en This issue is in English performance

Comments

@100pah
Copy link
Member

100pah commented Jul 24, 2021

Version

5.1.2

Steps to reproduce

            const POINT_COUNT = 1e7;
            const dzStart = 10;
            const dzEnd = 60;

            var option = {
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                    animation: false
                    }
                },
                legend: {},
                dataZoom: [{
                    show: true,
                    realtime: true,
                    // showDataShadow: false,
                    start: dzStart,
                    end: dzEnd
                }, {
                    type: 'inside',
                    start: dzStart,
                    end: dzEnd,
                }],
                xAxis: [{
                    type: 'time'
                }],
                yAxis: [{
                    type: 'value'
                }],
                series: [],
                animation: false
            };

            var lineStyle = {
                normal: {
                    width: 2,
                    opacity: 1
                }
            };

            var oneDay = 24 * 3600 * 1000;
            var base = +new Date(1987, 9, 3);
            var y = Math.random() * 1000;
            var values = new Float64Array(POINT_COUNT * 2);
            var off = 0;
            for (var j = 0; j < POINT_COUNT; j++) {
                y += Math.round(10 + Math.random() * (-10 - 10));
                values[off++] = base += oneDay;
                values[off++] = y;
            }

            option.series.push({
                name: 'line',
                type: 'line',
                hoverAnimation: false,
                showSymbol: false,
                sampling: 'lttb',
                dimensions: ['date', 'value'],
                encode: {
                    x: 'date',
                    y: 'value'
                },
                data: values,
                lineStyle: lineStyle
            });

Drag dataZoom slider bar, the rendering time is OK.
But pan on cartesian (that is, using dataZoom 'inside'), there is slow rendering, mainly caused on re-render of shadow in dataZoom slider (show in picture below, 289ms), which is unnecessary because it never changed.

Screen Shot 2021-07-24 at 6 20 11 PM

What is expected?

The performance of dataZoom 'inside' should the same as dataZoom 'slider'.

@echarts-bot echarts-bot bot added bug en This issue is in English labels Jul 24, 2021
@100pah 100pah added this to the 5.3 milestone Jul 24, 2021
@aahung
Copy link

aahung commented Sep 15, 2021

I also experience more performance hit when zooming using "inside" compared to "slider."

The getShallow took significant amount of time:

image

@pissang
Copy link
Contributor

pissang commented Sep 15, 2021

I'm not sure but it seems because slider zoom have throttle but inside zoom doesn't

@aahung
Copy link

aahung commented Sep 15, 2021

I am happy to be reached out if more info is needed when you start to investigate this issue. The zooming and panning are pretty laggy when more than ~1000 points in the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English performance
Projects
None yet
Development

No branches or pull requests

3 participants