The tests measure the performance of sets and dicts with integer keys. The following implementation are compared:
The following figures show the running time of creating a set of integers as a function of the number of integers (see _set_create.py for the source).
The following figure shows the performance of all the implementations:
The following figure shows the performance of all implementations with similar performance:
A sorted list has low overhead here, due to the fact that it performs a single allocation and hardly any further manipulation.
The following figures show the running time of creating a set of strings as a function of the number of strings (see _set_create.py for the source).
The following figure shows the performance of all the implementations:
The following figure shows the performance of all implementations with similar performance: