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

[REFACTOR] std::set usage to LLVM 17’s SmallPtrSet #16

Open
Casperento opened this issue Jan 30, 2025 · 2 comments
Open

[REFACTOR] std::set usage to LLVM 17’s SmallPtrSet #16

Casperento opened this issue Jan 30, 2025 · 2 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@Casperento
Copy link
Collaborator

Casperento commented Jan 30, 2025

The project currently uses std::set in various places to store unique elements. However, std::set is typically implemented as a balanced tree, which can be inefficient, especially for small sets of pointers.

LLVM 17 provides llvm::SmallPtrSet, which is optimized for such cases, offering better cache locality and performance. This refactoring aims to replace instances of std::set<T*> with llvm::SmallPtrSet<T*, N>, where N is chosen based on expected usage patterns.

While we recommend using SmallPtrSet, you are free to select a different LLVM data structure if it better suits a specific use case.

Tasks

  1. Identify all occurrences of std::set<T*> and evaluate whether they can be replaced with llvm::SmallPtrSet<T*, N>.
  2. Replace applicable instances, selecting an appropriate inline size (N) to optimize performance.
  3. Ensure all affected code compiles and passes existing tests.

References

@pronesto pronesto added the good first issue Good for newcomers label Jan 30, 2025
@LucianoPAlmeida
Copy link

Interested in this one!

@DanielAugusto191
Copy link
Collaborator

Nice, Thank You I will assign it to you! If there is any doubt, don't hesitate to ask!

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

No branches or pull requests

4 participants