Python is slow

G

George Sakkis

Buddy, just stop whining and go with c++ if it makes you happy.
By the way, what's the blazingly fast application you need to write so
desperately?
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! ?)...

Folks, do you *really* feel the urge to feed this troll and his 8-year-
old "arguments" again and again ? Please think twice before hitting
send on this pointless thread.
 
T

Tomasz Rola

In the next years people that use low-level languages like C may need
to invent a new language fitter for multi-core CPUs, able to be used
on GPUs too (see the OpenCL), less error-prone than C, able to use the
CPU vector instructions efficiently. (The D language is probably unfit
for this purpose, because even if it's meant to be a system language,
I don't think it can be used much to replace C everywhere it's used
now.) A C+ maybe? :)

Bye,
bearophile

I would say, this probably will be some descendant of Erlang and/or
Haskell. As evolutionary step, they look very promising to me, they just
are "not quite there" yet. As of C++, I cannot tell before I read their
new standard.

Regards,
Tomasz Rola

--
** A C programmer asked whether computer had Buddha's nature. **
** As the answer, master did "rm -rif" on the programmer's home **
** directory. And then the C programmer became enlightened... **
** **
** Tomasz Rola mailto:[email protected] **
 
R

r

Buddy, just stop whining and go with c++ if it makes you happy.
By the way, what's the blazingly fast application you need to write so
desperately?
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
 
J

James Mills

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:

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

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

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

jmills@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:

jmills@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!
 
R

r

What about all the crap you had to go through just to get output?
Python wins

PS. cm_gui try this piece of code
 
J

James Mills

What about all the crap you had to go through just to get output?
Python wins

Yes I can't say I really enjoy writing C (at all!)
_except_ in the case where I may need to
optimise some heavy computation. But then
again with multi-core CPUs these days and
cheap hardware, distributed processing is
not only easy, but very effective! And I still
wouldn't resort to C because well umm
psyco is just awesome!

--JamesMills
 
R

r

Yes I can't say I really enjoy writing C (at all!)
_except_ in the case where I may need to
optimise some heavy computation. But then
again with multi-core CPUs these days and
cheap hardware, distributed processing is
not only easy, but very effective! And I still
wouldn't resort to C because well umm
psyco is just awesome!

--JamesMills

This idiot(cm_gui) just needs to RTFM before going off on tirades like
a 3 year old. What i find so funny is after Luis asked "what's the
blazingly fast application you need to write so desperately?" we have
yet to hear from this "expert programmer". He is probably still trying
to get "hello world" to compile.
 
R

RadicalEd

http://blog.kowalczyk.info/blog/2008/07/05/why-google-should-sponsor-...

I fully agree with Krzysztof Kowalczyk .
Can't they build a faster VM for Python since they love the language
so much?

Python is SLOW.    And I am not comparing it with compiled languages
like C.
Python is even slower than PHP!

Just go to any Python website and you will know.
An example is:http://www2.ljworld.com/
And this site is created by the creators of Django!

And it is not just this Python site that is slow. There are many many
Python sites which are very slow. And please don’t say that it could
be the web hosting or the server which is slow — because when so many
Python sites are slower than PHP sites, it couldn’t be the web
hosting.   Also, Zope/Plone is even slower.

Python is slow. Very slow.

I did a DataBase consult with MySQLdb and PHP with 300000 rows and who
you think was the better and faster, YES, Python for almost 10
seconds, and I have to configure the php.ini for PHP could show me the
DATA.
He is just a futile troll frustrated with Python.
 
C

cm_gui

Seriously cm_gui, you're a fool.
Python is not slow.

--JamesMills

haha, getting hostile?
python fans sure are a nasty crowd.

Python is SLOW.

when i have the time, i will elaborate on this.
 
S

Steve Holden

cm_gui said:
haha, getting hostile?
python fans sure are a nasty crowd.

Python is SLOW.
Two lies in one posting!
when i have the time, i will elaborate on this.
Save your time, go somewhere else. Nobody here is interested.

regards
Steve
 
M

Marc 'BlackJack' Rintsch

haha, getting hostile?
python fans sure are a nasty crowd.

Python is SLOW.

when i have the time, i will elaborate on this.

You are not fast enough to elaborate on Python's slowness!? :)

cm_gui is slow!

Ciao,
Marc 'BlackJack' Rintsch
 
K

Krishnakant

With my current experience with java, python and perl, I can only
suggest one thing to who ever feels that python or any language is slow.
By the way there is only one language with is fastest and that is
assembly.
And with regards to python, I am writing pritty heavy duty applications
right now.
Just to mention I am totally blind and I use a screen reader called orca
on the gnome desktop. I hope readers here can understand that a screen
reader has to do a lot of real-time information processing and respond
with lightenning speed.
And Orca the scree reader is coded totally in python.
So that is one example.
So conclusion is is how you enhance your program by utilising the best
aspects of python.
happy hacking.
Krishnakant.
 
L

Luis M. González

RTFM, use as much python code and optimize with C where needed,
problem solved!

That's true if your *really* need C's extra speed.
Most of the times, a better algorithm or psyco (or shedskin) can help
without having to use any other language.
This is unless you are hacking a kernel, writing device drivers or 3D
image processing.
For anything else, python is fast enough if you know how to optimize
your code.

Luis
 
R

r

Could not have said it better myself Luis, i stay as far away from C
as i can. But there are usage cases for it.
 
J

James Mills

Could not have said it better myself Luis, i stay as far away from C
as i can. But there are usage cases for it.

If you can think of 1 typical common case
I'll reward you with praise! :)

By the way, by common and typical I mean
use-cases that you'd typically find in every
day applications and user tools, software,
games, etc.

In case anyone is not aware, Python is
also used for heavy scientific computational
problems, games such as Civilisation and
others, and I believe (correct me if I"m wrong)
it's also used by NASA.

--JamesMills
 
L

Lou Pecora

"James Mills said:
In case anyone is not aware, Python is
also used for heavy scientific computational
problems, games such as Civilisation and
others, and I believe (correct me if I"m wrong)
it's also used by NASA.

--JamesMills

Python has become very popular in scientific computation. You'll find
it in use lots of places (universities, national labs, defense labs). I
use it for solving partial differential equations for quantum chaos
calculations and went to C for speed up where needed using ctypes which
is very straightforward and plays nice with numpy array/matrix
libraries. I've been doing scientific programming for 30 years. Python
with C extensions and libraries is the best approach I've ever used.
Calculation speed is not a problem and the code can be "tweaked" to
increase it easily. Programming speed is incredible. I can get
substantial object oriented code up and running much faster than
anything I've ever used.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top