Improve RangeSet initialization performance (#75089)
When initializing a range set with a group of overlapping, identical,
or empty ranges, the initializer can exhibit poor performance due
to removing the unneeded ranges during processing. This change uses
a partitioning scheme instead, only removing the unnecessary ranges
at the end of initialization.