I'm assuming a set is internally a balanced tree of some sort. So lookup and insertions are O(log N). So N insertions should be O(N log N).
Edit - nevermind. It's a hash table of course. So I'm wrong.
Edit - nevermind. It's a hash table of course. So I'm wrong.
Actual times definitely more than O(N) growth.
Presumably the jump from 100k elements to 1mm elements hit that "cache locality" boundary you were referring to.