On Sep 19, 2019, at 15:18, Richard Musil
Ok, I misread the original code, the lists were not sorted in the previous results (and their should be). So with the correction to have them sorted,
I think to be fair, you want to show it _both_ ways, just as you’re showing sets both with and without creating the sets. Because sometimes you’re already going to have sorted lists, just as sometimes you’re already going to have sets. So there are four things to compare: * set operation on existing sets * set operation including time to build the sets * step-compare operation on pre-sorted lists * step-compare including time to sort the lists (Also, for the set operation, there’s no need to build _two_ sets. Just build a set of one and intersect it with the other list.) Anyway, from your two separate results, it looks like: * If you have sets, set operations are faster. * If you have unsorted lists, set operations are faster. * If you have sorted lists, the times are a lot closer, and may vary in a nonobvious way, so if it matters, you probably want to profile with your actual data and the specific operation you need.