Ok, how about this: replacing the heap with a normal array which only gets sorted every time right before a scrape run. That way we don't have to remove and re-add elements from it to step through the target list, which currently creates a long time during which target updates are blocked (because loose heap elements are flying around in Go routines somewhere, not tracked in the heap anymore, making target list replacements impossible).