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

A cython-based ordered_set to speedup discard operation #3277

Merged

Conversation

chaokunyang
Copy link
Contributor

@chaokunyang chaokunyang commented Oct 12, 2022

What do these changes do?

The discard operations in original orderedset in mars are O(n) complexity which are pretty slow.
image
This pr change it to a cython versioned orderedset which has O(1) complexity.

Before this PR, if we have many chunks for a band, remove_chunks will be the bottleneck for the system.
image
With this PR, the cost can be ignored:
image

Related issue number

Fixes #3278

Check code requirements

  • tests added / passed (if needed)
  • Ensure all linting tests pass, see here for how to run them

@chaokunyang chaokunyang requested a review from a team as a code owner October 12, 2022 10:33
@chaokunyang chaokunyang changed the title A new cython-based ordered_set to speedup discard operations A new cython-based ordered_set to speedup discard operation Oct 12, 2022
@chaokunyang chaokunyang changed the title A new cython-based ordered_set to speedup discard operation A cython-based ordered_set to speedup discard operation Oct 12, 2022
@chaokunyang chaokunyang force-pushed the optimize_orderedset_by_cython branch 2 times, most recently from 14ac270 to 6e27057 Compare October 20, 2022 03:02
@chaokunyang chaokunyang force-pushed the optimize_orderedset_by_cython branch from 6e27057 to 5aa7ded Compare October 20, 2022 06:55
@chaokunyang chaokunyang force-pushed the optimize_orderedset_by_cython branch from 1fba9a6 to e799780 Compare October 21, 2022 03:50
Copy link
Contributor

@zhongchun zhongchun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@fyrestone fyrestone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chaokunyang chaokunyang merged commit d8f896b into mars-project:master Oct 21, 2022
qianduoduo0904 pushed a commit to qianduoduo0904/mars that referenced this pull request Oct 24, 2022
…ct#3277)

* use cython ordered_set

* fix OrderedSet[str]

* lint code

* ignore pyx copyright

(cherry picked from commit d8f896b)
qianduoduo0904 pushed a commit to qianduoduo0904/mars that referenced this pull request Oct 24, 2022
…ct#3277)

* use cython ordered_set

* fix OrderedSet[str]

* lint code

* ignore pyx copyright

(cherry picked from commit d8f896b)
aresnow1 pushed a commit to xorbitsai/mars that referenced this pull request Oct 24, 2022
…ct#3277)

* use cython ordered_set

* fix OrderedSet[str]

* lint code

* ignore pyx copyright

(cherry picked from commit d8f896b)
qianduoduo0904 pushed a commit to qianduoduo0904/mars that referenced this pull request Oct 24, 2022
…ct#3277)

* use cython ordered_set

* fix OrderedSet[str]

* lint code

* ignore pyx copyright

(cherry picked from commit d8f896b)
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 this pull request may close these issues.

remove_chunks slow down onOrderedSet.dascard when there are many chunks
3 participants