Insert-Sort Performance

The tests measure the performance of sets and dicts with integer keys. The following implementation are compared:

Integer Sets

The following figures show the running time of inserting integers one by one into a set and iterating in sorted order after every insertion, as a function of the number of integers (see _set_insert_sort.py for the source).

The following figure shows the performance of all the implementations:

_images/IntSetInsertSortAll.png

The following figure shows the performance of all implementations with similar performance:

_images/IntSetInsertSortAllNoBlistBintrees.png

As the number of items increases, the cost of sorting incurred by the hash-based implementation grows. This is shown in the following figure, where larger numbers of items were used:

_images/IntSetInsertSortCompetitiveLarger.png

String Sets

The following figures show the running time of inserting strings one by one into a set and iterating in sorted order after every insertion, as a function of the number of integers (see _set_insert_sort.py for the source).

The following figure shows the performance of all the implementations:

_images/StrSetInsertSortAll.png

The following figure shows the performance of all implementations with similar performance:

_images/StrSetInsertSortAllNoBlistBintrees.png

As the number of items increases, the cost of sorting incurred by the hash-based implementation grows. This is shown in the following figure, where larger numbers of items were used:

_images/StrSetInsertSortCompetitiveLarger.png

Integer Dicts

The following figures show the running time of inserting integers one by one into a dict and iterating in sorted order after every insertion, as a function of the number of integers (see _set_insert_sort.py for the source).

The following figure shows the performance of all the implementations:

_images/IntDictInsertSortAll.png

The following figure shows the performance of all implementations with similar performance:

_images/IntDictInsertSortAllNoBlistBintrees.png

As the number of items increases, the cost of sorting incurred by the hash-based implementation grows. This is shown in the following figure, where larger numbers of items were used:

_images/IntDictInsertSortCompetitiveLarger.png

String Dicts

The following figures show the running time of inserting strings one by one into a dict and iterating in sorted order after every insertion, as a function of the number of integers (see _set_insert_sort.py for the source).

The following figure shows the performance of all the implementations:

_images/StrDictInsertSortAll.png

The following figure shows the performance of all implementations with similar performance:

_images/StrDictInsertSortAllNoBlistBintrees.png

As the number of items increases, the cost of sorting incurred by the hash-based implementation grows. This is shown in the following figure, where larger numbers of items were used:

_images/StrDictInsertSortCompetitiveLarger.png

Table Of Contents

This Page