Spacing and timing for comparing algorithms and data-structures

Chris Rebert clp2 at
Fri Mar 2 06:44:05 CET 2012

On Thu, Mar 1, 2012 at 8:55 PM, Alec Taylor <alec.taylor6 at> wrote:
> What would you recommend I use to compare data-structures and
> algorithms on space and time? (runtime)

For the latter metric, one of the profiling modules:
I'd start with timeit and go from there:

For the former metric, you can write your own memory use measurement
utility function on top of:
Or there is doubtless some Unix tool(s) you could use to get a more
crude measure of the total memory used by the Python interpreter


More information about the Python-list mailing list