done at all--tuples (stack win by hair in the last test case when there is no indexingas in the last testthe tuple and in-place change stacks are roughly six and five times quicker than the simple list-based stackrespectively since pushes and pops are most of what clients would normally do to stacktuples are contender heredespite their poor indexing performance of coursewe're talking about fractions of second after many tens of thousands of operationsin many applicationsyour users probably won' care either way if you access stack millions of times in your programthoughthis difference may accumulate to significant amount of time more on performance analysis two last notes on performance here although absolute times have changed over the years with new pythons and test machinesthese results have remained relatively the same that istuple-based stacks win when no indexing is performed all performance measurements in dynamic language like python are prone to change over timethoughso run such tests on your own for more accurate results secondthere' often more to performance measurement than timing alternatives this way for more complete pictureread about python' standard library profile module (and its optimized workalikecprofilethe profilers run python codecollect performance data along the wayand provide it in report on code exit it' the most complete way to isolate your code' bottleneckbefore you start working on optimizing with better codingalgorithmsand data structures or moving portions to the language for simple performance analysisthoughour timing module provides the data we need in factwe'll reuse it to measure more dramatic improvement in relative speed for set implementation alternatives--the topic of the next section implementing sets another commonly used data structure is the seta collection of objects that support operations such asintersection make new set with all items in common union make new set with all items in either operand membership test whether an item exists in set other operationssuch as difference and subset testscan be useful as welldepending on the intended use sets come in handy for dealing with abstract group combinations implementing sets