I'm assuming that there are duplicates, and I'm sorting them so we have the same list for every run.
If I understood right, you set
Sorted:= True; before adding to items.
As mentioned by Alpine and myself, adding items to a long sorted list is
VERY slow.
I don't know why you ignore this obvious place for optimization.
Better is if you sort the list after adding all items. Even then it is slower than a good Map container.
Around 3 minutes is not very fast in today's computers. You can do better.
Python is known to be slow. It has other advantages, not speed.