Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python is slower than Perl?

Name: Anonymous 2011-12-11 22:06

http://dan.corlan.net/bench.html
This benchmarking test shows that Python is over twice as slow as Perl. How can this be?

Name: Anonymous 2011-12-11 22:13

Languages don't have a speed.

Name: Anonymous 2011-12-11 22:35

The more whitespace you have indented your code the slower it gets, as the interpreter for loops over each character to arrive to the next instruction to execute, you can optimize this by converting to tabs or port to python's compiled variant Fixed Layout FORTRAN 77.

Name: Anonymous 2011-12-11 22:40

Name: Anonymous 2011-12-11 22:53

>>1
What are you talking about? There's a faster Python version.

Python tends to have faster overall execution, but I find the GC pauses worse than Perl.

Name: Anonymous 2011-12-11 23:48

http://web.archive.org/web/20081224115037/http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=all
http://shootout.alioth.debian.org/u64q/which-programming-languages-are-fastest.php


2008                     2011
====                     ====
                    _    C GNU gcc              1.05
C++ GNU g++    1.45 |    C++ GNU g++            1.21
                    |    Fortran Intel          1.21
                    |    Ada 2005 GNAT          1.22
ATS 1.67            |    ATS                    1.28
                    |    Java 7 averaged        1.47
Java 6 -server 2.20 |    Java 7 -server         1.76
                    |    Go                     2.09
                    |   _Scala                  2.18
                    |  _|Lisp SBCL              2.39
                    | _||C# Mono                2.82
                    |_|||OCaml                  2.91
Haskell GHC    2.42 |||||Haskell GHC            2.98
C GNU gcc      2.43 /||||
OCaml          2.96  /|||
Fortran Intel  3.17   |||
                      |||Pascal Free Pascal     3.21
C# Mono        4.17   /||
Lisp SBCL      4.57    /|
Clean          4.59     |
                    _   |Racket                 4.76
Scala          4.91 |   /
                    |    Clojure                5.48
Free Pascal    5.80 |
                    |    F# Mono                6.73
Ada 2005 GNAT  6.91 |   
Erlang HiPE    8.41 |    Erlang HiPE            10.47
Java 6 -Xint  13.64 |
Scheme PLT    13.70 /      
                         Erlang                 22.51
Smalltalk VW  24.19
Lua           25.13
Python        30.48  >         
                    _ \  PHP                    44.91
                    |    Python 3               45.27
                    |_   Ruby 1.9               49.76
                    ||   Ruby JRuby             51.83
Perl          55.60 ||>
Ruby JRuby    56.79 || \
PHP           56.86 /|  \
                     |   Perl                   89.02
Ruby         102.84  /   

Name: Anonymous 2011-12-12 0:10

Some fixes... HASKAL getting slower?

2008                     2011
====                     ====
                    _    C GNU gcc              1.05
C++ GNU g++    1.45 |    C++ GNU g++            1.21
                    |_   Fortran Intel          1.21
                    ||   Ada 2005 GNAT          1.22
ATS 1.67            ||   ATS                    1.28
                    ||   Java 7 averaged        1.47
Java 6 -server 2.20 ||   Java 7 -server         1.76
                    ||   Go                     2.09
                    ||  _Scala                  2.18
                    || _|Lisp SBCL              2.39
Haskell GHC    2.42 |> ||
C GNU gcc      2.43 /|\||
                     |_\|C# Mono                2.82
OCaml          2.96  |||\OCaml                  2.91
                     ||||Haskell GHC            2.98
Fortran Intel  3.17  /|||
                     _|||Pascal Free Pascal     3.21
C# Mono        4.17  |/||
Lisp SBCL      4.57  | /|
Clean          4.59  |  |
                    _|  |Racket                 4.76
Scala          4.91 ||  /
                    ||   Clojure                5.48
Free Pascal    5.80 |/
                    |    F# Mono                6.73
Ada 2005 GNAT  6.91 |   
Erlang HiPE    8.41 |    Erlang HiPE            10.47
Java 6 -Xint  13.64 |
Scheme PLT    13.70 /      
                         Erlang                 22.51
Smalltalk VW  24.19
Lua           25.13
Python        30.48  >         
                    _ \  PHP                    44.91
                    |    Python 3               45.27
                    |_   Ruby 1.9               49.76
                    ||   Ruby JRuby             51.83
Perl          55.60 ||>
Ruby JRuby    56.79 || \
PHP           56.86 /|  \
                     |   Perl                   89.02
Ruby         102.84  /   

Name: Anonymous 2011-12-12 1:57

>>7
How the fuck did Perl get so much slower?

Name: Anonymous 2011-12-12 3:17

So three of the top four use GCC for code generation. GHC started using LLVM.

Name: Anonymous 2011-12-12 10:18

>>6 >>7 >>8

The 2008 web.archive.org measurements show the Geometric Mean.

The 2011 measurements show the Median.


Here are 2011 measurements using the Geometric Mean

http://shootout.alioth.debian.org/u64q/which-language-is-best.php

Name: F r o z e n V o i d !!mJCwdV5J0Xy2A21 2011-12-12 10:22

I've hacked enough examples from that "shootout" to understand its written by retards who don't know how to optimize anything.
You can say "Java is faster than Fortran"(its in the data), because someone didn't bother optimizing the Fortran versions.

Name: Anonymous 2011-12-12 10:25

Racket is only 4 times slower than C. Seems about right. As far as I'm concerned if the number is less than 20, it's worth using the language instead of C.

Of course, now that C++11 is here, all languages that aren't C++ have been rendered totally obsolete.

Name: Anonymous 2011-12-12 10:26

>>11
The point should be to write idiomatic code, not idiotic code.

Name: Anonymous 2011-12-12 11:48

>>11

"in the data" Fortran median time is less than Java median time.

http://shootout.alioth.debian.org/u64q/which-programming-languages-are-fastest.php

Name: Anonymous 2011-12-12 11:57

>>11'
>implying you know anything about good optimization in other langs
>implying you can even optimize your shitty C programs

Name: Anonymous 2011-12-12 12:30

LANGS AND ALGOS

I hate you, faggot. Die in a fire.

Name: OP IS A !FAG 2011-12-12 12:48

benchmarks
2011

Name: Anonymous 2011-12-12 13:01

python slower than perl
too bad python is faster than any other dynamic language

Name: Anonymous 2011-12-12 14:40

>>10 ah.. T.T I'll redo it

2008(can't change)  2011
====                ====
n-body              n-body              1
fannkuch            fannkuch-redux      1 (is this similar?)
                    meteor-contest      0
fasta               fasta               1
                    fasta-redux         0
spectral-norm       spectral-norm       1
reverse-complement  reverse-complement  1
mandelbrot          mandelbrot          1
k-nucleotide        k-nucleotide        1
regex-dna           regex-dna           1
pidigits            pidigits            1
                    chameneos-redux     0
thread-ring         thread-ring         1
binary-trees        binary-trees        1



2008                          2011
====                          ====
C++ GNU g++        1.45       C++ GNU g++        1.60
                              Java 7 averaged    1.65
ATS                1.67   >
                           \_ C GNU gcc          1.75
                           _\ Ada 2005 GNAT      2.10
Java 6 -server     2.20 >  ||\
                         \ || ATS                2.26
Haskell GHC        2.42 > \||
C GNU gcc          2.43  \ \/
                        _ \|\ Fortran Intel      2.33
                        |  \  Java 7 -server     2.45
                        |  |  Haskell GHC        2.90
OCaml              2.96 >  | 
                        |\_|  Scala              3.01
Fortran Intel      3.17 / \| 
                          |\  Go                 3.22
                         _||\ Lisp SBCL          3.41
                         |||  OCaml              3.70
                         |||_ Pascal Free Pascal 4.17
C# Mono            4.17  >|||
Lisp SBCL          4.57  /\||
Clean              4.59   |\|
Scala              4.91   /|\
                           || C# Mono            4.97
                           || Clojure            5.16
Pascal Free Pascal 5.80    |/
                           |_ Racket             5.94
                           || F# Mono            6.49
Ada 2005 GNAT      6.91    /|
Erlang HiPE        8.41     | Erlang HiPE       11.54
Java 6 -Xint      13.64     |
Scheme PLT        13.70     /
                              Erlang            19.78
Smalltalk VW      24.19      
Lua               25.13      
Python            30.48       Python 3          28.88
                        _     PHP               34.85
                        | _   Ruby JRuby        43.09
                        |_|   Ruby 1.9          45.09
Perl              55.60 |||   Perl              51.03
Ruby JRuby        56.79 ||/  
PHP               56.86 /|   
Ruby             102.84  /   

Name: Anonymous 2011-12-12 17:18

>>18

too bad python is faster than any other dynamic language

"LOL"

x86 Intel Q6600 one core median
JavaScript V8 4.22
Ruby 1.9 36.43   
PHP 45.15
Perl 54.72
Python 3 58.05

x64 Intel Q6600 one core median
JavaScript V8 5.13
Ruby 1.9 33.34   
PHP 37.73
Python 3 46.57
Perl 56.77

Name: Anonymous 2011-12-12 18:13

>>20
Intel
You must be Jew here.

Name: Anonymous 2011-12-12 18:15

>>20
javascript
yeah like anybody would use this if they had the choice

Name: Anonymous 2011-12-12 20:31

>>22
I do. I was writing multi-expression lambdas in chained method calls in JS today. I stopped short of using combinators when I realized other staff members might have a hard time following it if they needed to make changes (it wasn't saving me much anyway.)

I chose it over 4 other popular languages I had the option of using for this particular problem.

Name: Anonymous 2011-12-12 20:47

>>23
awesome. javascript is the future; no other scripting language even comes close to harmony's feature set

Name: Anonymous 2011-12-12 22:40

>>19
Java 7 averaged    1.65
What happened?

Name: Anonymous 2011-12-13 0:00

>>24
I am not 100% certain about that, as long as we're talking about pre-production languages. There's a few in the works I'd like to explore. But if I had to pick two to keep I would not hesitate to choose JS as one of them.

Name: Anonymous 2011-12-13 11:57

>>25

Nothing much happened - it's a statistical artifact.

That simple approach to approximate averages doesn't work for every task, and coincidentally where the approach does work the Java programs perform somewhat better, and the result is another example why the median is a more sensible choice of descriptive statistic than the geometric mean.

http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=javasteady#faster-programs-measurements

Don't change these.
Name: Email:
Entire Thread Thread List