Benchmarking module for Python

Jose Martin joseamartin at venmex.com
Thu Feb 1 09:43:50 EST 2001


hI PAUL

you can use the clock function, in python 2.0 this function was improved.


I am using clock function to crack some passwords and works very well.

good look !.


Paul Moore <paul.moore at uk.origin-it.com> escribió en el mensaje de noticias
2P53OlqNc5Cg7uVAjN=rZZ5t6Jix at 4ax.com...
> I'm looking for a method of benchmarking snippets of Python code, a
> bit like Perl's Benchmark module. I have looked at the profile module,
> but it doesn't seem to do quite what I want.
>
> What I'm after, given a line of code, is something that will let me
> run that line a specified number of times, say 1000, and see the
> average time that the line took.
>
> I can do something like that with profile, by wrapping my code in a
> function, and profiling 'for i in xrange(1000): fn()', and then
> extracting the time spent per call in fn(). But it's a bit of a long
> way round to get what I want.
>
> Ideally, I'd like to be able to reuse the timing code from profile,
> but if not, then an independent benchmark module would be OK. All I
> found on Parnassus was PyBench, which tests a standard set of tasks.
>
> Is there any such thing, or should I start coding?
>
> Paul.
>
> PS Yes, I know that benchmarks are meaningless....
>





More information about the Python-list mailing list