I make many, many attachments to std::pair<int, int> in std::set , and it takes longer than I would like. When I wrote the code, I decided that I would see how to use the form of the insert hint iterator later if it turned out to be a bottleneck; well, now he's profiled, and is the bottleneck. So I want to use an iterator hint.
However, I will not always know a good position to insert my pairs. Usually I insert them into lots (the lot in this case is about 0.01% of the total input size, including duplicates) of the increase in the given order, but when the lot is inserted, I donβt know where the next Start is. How is this hint used? Does something like binary search insert from a suggested position? How bad would it be to use a bad hint, usually?
carlpett
source share