i'm sure it could be faster to use hash-set instead of (into #{}).
Can you check this?

In my experience it's half the time.