Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #21120 > unrolled thread

Re: Spacing and timing for comparing algorithms and data-structures

Started byChris Rebert <clp2@rebertia.com>
First post2012-03-01 21:44 -0800
Last post2012-03-01 21:44 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Spacing and timing for comparing algorithms and data-structures Chris Rebert <clp2@rebertia.com> - 2012-03-01 21:44 -0800

#21120 — Re: Spacing and timing for comparing algorithms and data-structures

FromChris Rebert <clp2@rebertia.com>
Date2012-03-01 21:44 -0800
SubjectRe: Spacing and timing for comparing algorithms and data-structures
Message-ID<mailman.338.1330667047.3037.python-list@python.org>
On Thu, Mar 1, 2012 at 8:55 PM, Alec Taylor <alec.taylor6@gmail.com> 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:
http://docs.python.org/library/debug.html
I'd start with timeit and go from there:
http://docs.python.org/library/timeit.html

For the former metric, you can write your own memory use measurement
utility function on top of:
http://docs.python.org/library/sys.html#sys.getsizeof
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
process.

Cheers,
Chris
--
http://rebertia.com

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web