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

label 中有一部分十分耗费性能的代码看起来没有作用,确认是否可删除 #3709

Closed
Heng77 opened this issue Nov 8, 2021 · 1 comment · Fixed by #3884
Assignees

Comments

@Heng77
Copy link

Heng77 commented Nov 8, 2021

  • G2 Version:4.1.34
    image
    有一个疑问,不知道红色框内的代码是否有作用?
    因为这段代码在一些情况下(比如柱图)的时间复杂度是O(n²),在大数据量时会十分耗费性能。
    我尝试把这段代码注掉,整体看起来对 label 相关的功能没有影响。
    因此想确认一下是否为历史代码?是否可删除呢?
@visiky visiky self-assigned this Dec 28, 2021
@visiky
Copy link
Member

visiky commented Apr 20, 2022

这里的对应关系是这样的:
Geometry -> Element (1: n)
Element -> Label (1:1)

估计只是为了设置 element.labelShape 才去做 filter 的,大概的复杂度 n*m+m (n: elements 的数量,m: labelsMap的数量)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants