Skip to content

Conversation

@edmundnoble
Copy link

@edmundnoble edmundnoble commented Nov 7, 2024

These operations allow efficient deletes from an IxSet. These are often useful to filter an IxSet in a way that doesn't require rebuilding indices.

@edmundnoble edmundnoble force-pushed the push-kunxlzvyouzn branch 3 times, most recently from 25a65ae to 8b3227c Compare November 7, 2024 23:32
Copy link
Member

@adamgundry adamgundry left a comment

Choose a reason for hiding this comment

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

Thanks for proposing this! I'm also using ixset-typed in a way that would benefit from efficient (filtering and) deletion.

I notice that Data.IxSet.Typed.Ix.deleteSet is at least linear in the size of the map (i.e. the number of distinct keys), and Data.IxSet.typed.difference ignores the index maps. Couldn't we use the index maps to know which specific keys contain elements being deleted, and thereby have something more efficient, in particular in the case of large-ixset \\ small-ixset?

Also, it seems there isn't a filter operation yet, but presumably one add it along the lines of this PR?

cc @kosmikus

@edmundnoble
Copy link
Author

I hadn't thought of that. That seems like a strict improvement. Thanks @adamgundry. I'll give that a go.

@edmundnoble
Copy link
Author

@adamgundry I've done as you asked. I'm very glad to hear that someone else would benefit from these functions. I have also done a follow-up which adds filter.

These operations allow for efficient deletes from an IxSet.
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.

2 participants