# Best data structure for fast unions of large sets of integers

**URL:** https://discourse.julialang.org/t/best-data-structure-for-fast-unions-of-large-sets-of-integers/113785
**Category:** Performance
**Tags:** performance, set, datastructures
**Created:** [May 3, 2024, 10:32am UTC](https://discourse.julialang.org/t/best-data-structure-for-fast-unions-of-large-sets-of-integers/113785 "2024-05-03T10:32:04Z")
**Posts on this page:** 1
**Showing post:** 53

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [May 6, 2024, 4:57pm UTC](https://discourse.julialang.org/t/best-data-structure-for-fast-unions-of-large-sets-of-integers/113785/53 "2024-05-06T16:57:01Z")

</div>

See this new topic for a discussion of the recursive set idea, if the performance nerds are not tired yet!

> [@Can I speed up this recursive set implementation?](https://discourse.julialang.org/t/can-i-speed-up-this-recursive-set-implementation/113917):
>
> Hey there! I come to you with another performance nerdsnipe, whose solution could have a big impact on the autodiff ecosystem (via SparseConnectivityTracer.jl and DifferentiationInterface.jl). You may remember my first question on pseudo-set data structures for fast unions: One interesting proposal from that discussion (thanks @Tarny_GG_Channie) is a lazy set union, containing only pointers to the two sets it unites. I want to see how fast we can make this approach. The code below benchmar…

---

_[View the full topic](https://discourse.julialang.org/t/best-data-structure-for-fast-unions-of-large-sets-of-integers/113785)._
