Skip to content

[Bug] Using dataset with random numbers is mush slower #20175

@zkycaesar

Description

@zkycaesar

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?code=MYewdgzgLgBADlA-mArgWxgXhgRgAwEEDcAUADYCmsAHgGoCGZKFEWMYFA7jAJJhQBmAEwBBAE5j6ATwAUCZOgCUpSrCkMmLNh24AxMiHpQAbABZxk2fNRplJAPT2YqmOsbMIQ7Vxj7Dg0QlpOSQbOwAzEDEYGRcASzY8IhgEgB54UPRkuIBqHMUYAG8SGFKYOncWAG04gF02ONIymEdXDQ8a-uwAWSMACwA6STAAExA0GTtmt00ITrZeqEGIOLAZBKd8AjsAXxKykhAEOPA2YtLqEWo4iAAuIv3SqCk4CnuAcgA3SveAGn2dv9SlIrjd7ucys9Xh9vpp3gCgTARkZ6BAqODHmU4iMPlBJMAKABaHB_TGlEZxNAUSAnSC3Kpk5pFdj0Kkfah_GBQt4wd6rKDvQEwRnNQostm8qSc7kfcIGIyCxm1RHNCAgFBiAn3KoVWa_NqVCC1BH7NFiOIsDFM8U8954-gE4mk60y3lkVYUZ1MihoOB9VFgh7W5oUiD0ABGlBxXLEzBVZUBjNaYd97rAAHMPmQoFBw17mmmKABlZ6UcEwTjYpb3HAwRPWiB9ECcItSNDhkBke7hRho-PkynUlbgO4M4NlMVgVm2jn6118_iC_Uiic2j5SucvW1y_yK63KxnU0AjHkQ8fvKXr_PB94c9nw631plmi0QAAy0nVUAAQlIPmJmy9PYdiIIA

Steps to Reproduce

I find that if I use random numbers as dataset, like Math.random(), the line chart rendering will be very slow. But using dataset with some pattern, like Math.sin(i), it will be much faster.

Please have a look at the demo: demo. Uncomment line 7, and comment line 8.

Am I doing something wrong or this is a performance issue?

Current Behavior

Using random numbers as dataset will be much slower.

Expected Behavior

The performance should be the same.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions