n Wed, Dec 17, 2008 at 8:24 AM, r <rt8...@gmail.com> wrote:
>> What kind of performance problem have you find in python that makes
>> you so unhappy?
>> What are you going to do with all the extra speed provided by c++ (a
>> Hello World! ?)...
>
> Still no reply from cm_gui, he must have googled "C hello world" :D

I must be mad for doing this - but I feel so strongly
about this topic. In 99.9% of cases generally things
are "feast enough"! So here goes:

jmi...@atomant:~$ cat - > hello.c
int main (int argc, char ** argv) {
    printf("Hello World!\n!");
}
jmi...@atomant:~$ tcc hello.c -o hello
jmi...@atomant:~$ wc -l hello.c
3 hello.c
jmi...@atomant:~$ ls -l hello.c
-rw-r--r-- 1 jmills jmills 69 2008-12-17 08:41 hello.c
jmi...@atomant:~$ ls -l hello
-rwxr-xr-x 1 jmills jmills 2972 2008-12-17 08:41 hello

jmi...@atomant:~$ time ./hello
Hello World!
!
real    0m0.003s
user    0m0.000s
sys     0m0.004s

jmi...@atomant:~$ cat - > hello.py
print "Hello World!"

jmi...@atomant:~$ time python hello.py
Hello World!

real    0m0.129s
user    0m0.016s
sys     0m0.020s

OMG OMG OMG! Python is slower!
If you compare "sys" times ~5x slower!

BUT ... This is in fact a misleading as most of
this is in the startup time. So let's be fairer:

jmi...@atomant:~$ time python -E -S hello.py
Hello World!

real    0m0.011s
user    0m0.008s
sys     0m0.004s

Wow! Only ~2x as slow as C.

--JamesMills

PS: Yet another useless post!
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to