Python 2 times slower than Perl
John J. Lee
phrxy at csv.warwick.ac.uk
Wed Jul 18 15:08:15 EDT 2001
On 18 Jul 2001, Johann Hibschman wrote:
[...]
> cc -O2 0.28
> cc 0.62
> ocamlopt 1.26 (compiled)
> ocaml 9.42 (interpreted)
> perl 28.9
> python 66.8
>
> Hm. I'm beginning to wonder if I compiled python with -O2 or not.
> Plus, I'm becoming more and more fond of ocaml.
>
> The python function I used was the basic
>
> def test ():
> i = 2.5
> j = 2.5
> while i < 1e7:
> j = 2.5 * 2.5
> i = i + 1.0
> print "%f %f\n" % (i, j)
>
> if __name__ == '__main__':
> test ()
When do you ever write Python code that does this kind of thing?? For
example, if you're doing lots of fp work, don't you use Numeric?
Must try OCaml, though (and Haskell)...
John
More information about the Python-list
mailing list