Re: Python Performance Speculations

  • From: "Jacob Kruger" <jacobk@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 21 Jun 2011 10:57:41 +0200

A simple example, that might not be relevant, but which is something I specifically tested, just because I could, was to use random.randint(100) like hundred thousand times, and then use the more low level random.random function, then converting it's output between 0 and 1 to 1 to 100 using multiplication, and that sort of double operation actually performed in around a third of the time - used the time module to time them both in milliseconds to make sure.


Stay well

Jacob Kruger
Blind Biker
Skype: BlindZA
'...fate had broken his body, but not his spirit...'

----- Original Message ----- From: "Kerneels Roos" <kerneels@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Tuesday, June 21, 2011 10:26 AM
Subject: Python Performance Speculations


Hi list,

Since the fasterst Python interpreter is written in C is should be possible, with a deep knowledge of the implementation, to code in Python algorithms that will run at the same speed as algorithms coded in C, but in much less time (development time) should it not?

I suspect / speculate that the bulk of Python performance problems is attributable to how Python is used since it allows you to do so much, a lot of which is not done very efficiently, yet still is done, so if you take care you can do things more efficiently in Python alone.

Now, the problems with this or that part of the standard API, like what Ken was saying about the threading is a whole other matter. That alone might make the language unsuitable. There is usually commercial alternatives though, like with C++ threading and misc third party APIs.

Last time I checked the Python interpreter written in Python was significantly slower than the C one.

Keep well,
Kerns

--
Kerneels Roos
Cell: +27 (0)82 309 1998
Skype: cornelis.roos

__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: