[issue45753] Further speed up Python-to-Python calls.

2021-12-01 Thread Mark Shannon
Mark Shannon added the comment: New changeset 49444fb807ecb396462c8e5f547eeb5c6bc5d4de by Mark Shannon in branch 'main': bpo-45753: Interpreter internal tweaks (GH-29575) https://github.com/python/cpython/commit/49444fb807ecb396462c8e5f547eeb5c6bc5d4de --

[issue45753] Further speed up Python-to-Python calls.

2021-11-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +27819 pull_request: https://github.com/python/cpython/pull/29575 ___ Python tracker ___

[issue45753] Further speed up Python-to-Python calls.

2021-11-16 Thread Mark Shannon
Mark Shannon added the comment: New changeset b9310773756f40f77e075f221a90dd41e6964efc by Mark Shannon in branch 'main': bpo-45753: Make recursion checks more efficient. (GH-29524) https://github.com/python/cpython/commit/b9310773756f40f77e075f221a90dd41e6964efc --

[issue45753] Further speed up Python-to-Python calls.

2021-11-11 Thread Brandt Bucher
Change by Brandt Bucher : -- nosy: +brandtbucher ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45753] Further speed up Python-to-Python calls.

2021-11-11 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +27774 pull_request: https://github.com/python/cpython/pull/29524 ___ Python tracker ___

[issue45753] Further speed up Python-to-Python calls.

2021-11-10 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +27768 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29516 ___ Python tracker ___

[issue45753] Further speed up Python-to-Python calls.

2021-11-08 Thread Mark Shannon
essages: 405970 nosy: Mark.Shannon priority: normal severity: normal status: open title: Further speed up Python-to-Python calls. type: performance versions: Python 3.11 ___ Python tracker <https://bugs.pyt

[issue34296] Speed up python startup by pre-warming the vm

2019-12-20 Thread Eric Snow
Change by Eric Snow : -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34296] Speed up python startup by pre-warming the vm

2018-08-08 Thread INADA Naoki
INADA Naoki added the comment: On Thu, Aug 9, 2018 at 3:17 AM Cyker Way wrote: > > Cyker Way added the comment: > > I'm fine with stdlib, 3rd party tools, or whatever. My focus is to understand > is whether this idea can be correctly implemented on the python VM or not. > I've been

[issue34296] Speed up python startup by pre-warming the vm

2018-08-08 Thread Cyker Way
T is able to do it, and what would be the case for the python VM? A few more words about my original vision: I was hoping to speed up python script execution using template VMs in which a list of selected modules are preloaded. For example, if you have one script for regex matching, and a

[issue34296] Speed up python startup by pre-warming the vm

2018-08-08 Thread Ronald Oussoren
Ronald Oussoren added the comment: This might be a useful feature but I think it would be better to develop this outside the stdlib, especially when the mechanism needs application specific code (such as preloading modules used by a specific script). If/when such a tool has enough traction

[issue34296] Speed up python startup by pre-warming the vm

2018-08-07 Thread INADA Naoki
INADA Naoki added the comment: On Wed, Aug 8, 2018 at 6:40 AM Cyker Way wrote: > > Cyker Way added the comment: > > > While this issue is "pre warming VM", VM startup is not significant part > > of your 500ms. > > 10-20ms should be OK for shell scripts. But a fork is still faster. > > >

[issue34296] Speed up python startup by pre-warming the vm

2018-08-07 Thread Cyker Way
Cyker Way added the comment: > While this issue is "pre warming VM", VM startup is not significant part of > your 500ms. 10-20ms should be OK for shell scripts. But a fork is still faster. > You're talking about application specific strategy now. It's different of > this issue.

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki
INADA Naoki added the comment: * While this issue is "pre warming VM", VM startup is not significant part of your 500ms. * You're talking about application specific strategy now. It's different of this issue. And many ideas like yours are already discussed on ML, again and again. I feel

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread Cyker Way
Cyker Way added the comment: It was tested on a x86_64 Linux system. The machine is not quite new but is OK for building and running python. The test script is actually a management tool for a larger project that is not released in public so I don't have right to disclose it here. When

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki
INADA Naoki added the comment: > I understand many things can happen while importing a library. But for a > specific program, its imports are usually fixed and very much likely the same > between runs. That's why I believe a zygote/fork/snapshot feature would still > be helpful to help

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki
INADA Naoki added the comment: > In my tests, a helloworld python script generally takes about 30-40 ms. [snip] > Finally, for simple and quick user scrips, the 30-40 ms startup time without > any import statements may not be a huge problem, but it's still tangible and > makes the program

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread Cyker Way
Cyker Way added the comment: > VM startup + `import site` are done in 10~20ms on common Linux machine. > While Python VM startup is not lightning fast, library import time is much > slower than VM startup in many cases. In my tests, a helloworld python script generally takes about 30-40

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki
tartup is not lightning fast, library import time is much slower than VM startup in many cases. And since "importing library" may have many important side effects, we can't "pre warm" it. Have you tried `PYTHONPROFILEIMPORTTIME=1` environment variable added by Python 3.7? https://dev.

[issue34296] Speed up python startup by pre-warming the vm

2018-08-06 Thread INADA Naoki
Change by INADA Naoki : -- nosy: +inada.naoki versions: -Python 3.6, Python 3.7 ___ Python tracker ___ ___ Python-bugs-list

[issue34296] Speed up python startup by pre-warming the vm

2018-08-04 Thread Nick Coghlan
Nick Coghlan added the comment: It isn't currently feasible to do anything along these lines, as the CPython runtime is highly configurable, so it's far from clear what, if anything, could be shared from run to run, and nor is it clear how the interpreter could check whether or not the

[issue34296] Speed up python startup by pre-warming the vm

2018-08-03 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34296] Speed up python startup by pre-warming the vm

2018-08-03 Thread Terry J. Reedy
Terry J. Reedy added the comment: We are aware that startup time is a issue, especially for quick scripts. I don't know if your ideas have been considered, so I added a couple of people who might. The python-ideas list would likely be a better place for discussion until there is some idea

[issue34296] Speed up python startup by pre-warming the vm

2018-07-31 Thread Cyker Way
a look. But I don't think these scenarios have already been put into released versions of python. -- components: Interpreter Core messages: 322800 nosy: cykerway priority: normal severity: normal status: open title: Speed up python startup by pre-warming the vm type: enhancement versions

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Steven D'Aprano
On Thursday 10 November 2016 17:43, breamore...@gmail.com wrote: > On Thursday, November 10, 2016 at 1:09:31 AM UTC, Steve D'Aprano wrote: >> > > [snipped] > > Steven, there is no need to be rude or condescending. Indeed, and if I thought you were sincere, or knew what you were objecting

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 12:16 PM, BartC wrote: > But now that I was about to use it, another problem. The Ubuntu Python is > 2.7. The Windows one has both 2.7 and 3.4 (and my IDE can select either). > > The bit of code I wanted to run has Py3-style print functions. I tried >

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 10/11/2016 01:16, BartC wrote: I suppose I can get rid of the prints for the test I wanted to do, or find out how to do the same thing under Py2 print. Or install Py3 on Ubuntu, which is a big job and I've no idea how to switch between them. Some good news, it turned out Ubuntu had both

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 10/11/2016 00:38, Michael Torrie wrote: On 11/09/2016 02:10 PM, BartC wrote: Good point, I use Ubuntu under Windows. It should be child's play, except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. Something is wrong with your setup then. Because both python-numpy and

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Steve D'Aprano
On Thu, 10 Nov 2016 11:38 am, Michael Torrie wrote: > On 11/09/2016 02:10 PM, BartC wrote: >> Good point, I use Ubuntu under Windows. It should be child's play, >> except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > Something is wrong with your setup then. Bart has been

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 11:38 AM, Michael Torrie wrote: > On 11/09/2016 02:10 PM, BartC wrote: >> Good point, I use Ubuntu under Windows. It should be child's play, >> except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > Something is wrong with your setup

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Michael Torrie
On 11/09/2016 02:10 PM, BartC wrote: > Good point, I use Ubuntu under Windows. It should be child's play, > except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. Something is wrong with your setup then. Because both python-numpy and python3-numpy are in the standard ubuntu

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Chris Angelico
On Thu, Nov 10, 2016 at 8:35 AM, wrote: > I don't actually use pip much myself, I use Synaptic Package Manager. Unless > you need a package from the PSF repository that Canonical doesn't have, > Synaptic should be fine for you. If you want to run the Python3 version of >

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread jladasky
On Wednesday, November 9, 2016 at 1:10:34 PM UTC-8, BartC wrote: > On 09/11/2016 19:44, j...@i...edu wrote: > Good point, I use Ubuntu under Windows. It should be child's play, > except... 'sudo apt-get install numpy' or 'python-numpy' doesn't work. > > 'pip' doesn't work; it needs to be

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 09/11/2016 19:44, jlada...@itu.edu wrote: On Wednesday, November 9, 2016 at 5:03:30 AM UTC-8, BartC wrote: On 05/11/2016 17:10, Mr. Wrobel wrote: 1. What I have found is modified python interpreter - pypy - http://pypy.org that does not require any different approach to develop your code.

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread jladasky
On Wednesday, November 9, 2016 at 5:03:30 AM UTC-8, BartC wrote: > On 05/11/2016 17:10, Mr. Wrobel wrote: > > > 1. What I have found is modified python interpreter - pypy - > > http://pypy.org that does not require any different approach to develop > > your code. > > > > 2. And: Gpu based

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread BartC
On 05/11/2016 17:10, Mr. Wrobel wrote: 1. What I have found is modified python interpreter - pypy - http://pypy.org that does not require any different approach to develop your code. 2. And: Gpu based computing powered by Nvidia (NumbaPro compiler):

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Steve D'Aprano
On Wed, 9 Nov 2016 06:35 pm, John Ladasky wrote: [...] > I work a lot with a package called GROMACS, which does highly iterative > calculations to simulate the motions of atoms in complex molecules. > GROMACS can be built to run on a pure-CPU platform (taking advantage of > multiple cores, if

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-09 Thread Christian Gollwitzer
Am 08.11.16 um 02:23 schrieb Steve D'Aprano: But as far as I know, they [NVidia] 're not the only manufacturer of GPUs, and they are the only ones who support IEEE 754. So this is *exactly* the situation I feared: incompatible GPUs with varying support for IEEE 754 making it difficult or

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-08 Thread John Ladasky
On Monday, November 7, 2016 at 5:23:25 PM UTC-8, Steve D'Aprano wrote: > On Tue, 8 Nov 2016 05:47 am, j...@i...edu wrote: > > It has been very important for the field of computational molecular > > dynamics (and probably several other fields) to get floating-point > > arithmetic working right on

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-07 Thread Steve D'Aprano
On Tue, 8 Nov 2016 05:47 am, jlada...@itu.edu wrote: > On Saturday, November 5, 2016 at 6:39:52 PM UTC-7, Steve D'Aprano wrote: >> On Sun, 6 Nov 2016 09:17 am, Mr. Wrobel wrote: >> >> >> I don't have any experience with GPU processing. I expect that it will be >> useful for somethings, but for

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-07 Thread Michael Torrie
On 11/05/2016 11:10 AM, Mr. Wrobel wrote: > Hi, > > Some skeptics asked my why there is a reason to use Python against of > any other "not interpreted" languages, like objective-C. As my > explanation, I have answered that there is a a lot of useful APIs, > language is modern, has advanced

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-07 Thread Adam M
On Saturday, November 5, 2016 at 8:58:36 PM UTC-4, Steve D'Aprano wrote: > On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote: > > > Steve D'Aprano writes: > > >> Here's the same program in Objective C: > >> > >> --- cut --- > >> > >> #import > >> > >> int main (int argc,

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-07 Thread jladasky
On Saturday, November 5, 2016 at 6:39:52 PM UTC-7, Steve D'Aprano wrote: > On Sun, 6 Nov 2016 09:17 am, Mr. Wrobel wrote: > > > I don't have any experience with GPU processing. I expect that it will be > useful for somethings, but for number-crushing and numeric work, I am > concerned that GPUs

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-06 Thread dieter
"Mr. Wrobel" writes: > ... > However the same skeptics told my that, ok we believe that it is true, > however the code execution is much slower than any other compiled > language. However, in many cases "code execution speed" is not the primary concern. In my experience,

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
Steve D'Aprano writes: > On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote: > >> Steve D'Aprano writes: > >>> Here's the same program in Objective C: >>> >>> --- cut --- >>> >>> #import >>> >>> int main (int argc, const char * argv[]) >>>

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Steve D'Aprano
On Sun, 6 Nov 2016 09:17 am, Mr. Wrobel wrote: > However the most important is second part of my question. > > What do you think about using GPU processing or pypy? I don't have any experience with GPU processing. I expect that it will be useful for somethings, but for number-crushing and

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Steve D'Aprano
On Sun, 6 Nov 2016 08:17 am, Ben Bacarisse wrote: > Steve D'Aprano writes: >> Here's the same program in Objective C: >> >> --- cut --- >> >> #import >> >> int main (int argc, const char * argv[]) >> { >> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
"Mr. Wrobel" writes: > ... However the most important is second part of my question. > > What do you think about using GPU processing or pypy? Sorry, I don't have enough experience of them to offer any useful advice. -- Ben. --

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
W dniu 05.11.2016 o 22:17, Ben Bacarisse pisze: Steve D'Aprano writes: On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote: Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objective-C. Here's the

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Ben Bacarisse
Steve D'Aprano writes: > On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote: > >> Hi, >> >> Some skeptics asked my why there is a reason to use Python against of >> any other "not interpreted" languages, like objective-C. > > Here's the "Hello World" program in Python: >

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Steve D'Aprano
On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote: > Hi, > > Some skeptics asked my why there is a reason to use Python against of > any other "not interpreted" languages, like objective-C. Here's the "Hello World" program in Python: --- cut --- print("Hello World") --- cut --- Here's the

[Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objective-C. As my explanation, I have answered that there is a a lot of useful APIs, language is modern, has advanced objective architecture, and what is the most important

Re: Speed of Python

2007-09-11 Thread Dick Moores
At 09:42 AM 9/7/2007, wang frank wrote: Are there any way to speed it up? How about psyco? Dick Moores XP, Python 2.5.1, editor is Ulipad -- http://mail.python.org/mailman/listinfo/python-list

Re: Speed of Python

2007-09-08 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Sep 2007 23:53:48 +, wang frank wrote: From: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] To: python-list@python.org Subject: Re: Speed of Python Date: 7 Sep 2007 23:17:55 GMT On Fri, 07 Sep 2007 22:59:26 +, wang frank wrote: I also have tried to use numpy to speed it up

Re: Speed of Python

2007-09-07 Thread S bastien Boisg rault
On Sep 7, 6:42 pm, wang frank [EMAIL PROTECTED] wrote: Matlab (aka MATrix LABoratory) has been designed with numeric computations in mind (every object being natively a n-dim array). If you wish to develop that kind of applications in Python, consider using the numerical array structure provided

Re: Speed of Python

2007-09-07 Thread Roberto Bonvallet
On Sep 7, 12:42 pm, wang frank [EMAIL PROTECTED] wrote: Here is the bench1.py: import math def bench1(n): for i in range(n): for j in range(1000): m=j+1 z=math.log(m) z1=math.log(m+1)

Speed of Python

2007-09-07 Thread wang frank
Hi, While comparing the speed of octave and matlab, I decided to do a similar test for python and matlab. The result shows that python is slower than matlab by a factor of 5. It is not bad since octave is about 30 time slower than matlab. Here is the result in matlab: Elapsed time is

Re: Speed of Python

2007-09-07 Thread Roberto Bonvallet
On Sep 7, 1:37 pm, wang frank [EMAIL PROTECTED] wrote: Hi, Here is the matlab code: function [z]=bench1(n) for i=1:n, for j=1:1000, z=log(j); z1=log(j+1); z2=log(j+2); z3=log(j+3); z4=log(j+4); z5=log(j+5); z6=log(j+6);

Re: Speed of Python

2007-09-07 Thread wang frank
; I am not familiar with python, so I just simply try to reproduce the same code in python. If you think that my python script is not efficient, could you tell me how to make it more efficient? Thanks Frank From: Roberto Bonvallet [EMAIL PROTECTED] To: python-list@python.org Subject: Re: Speed

Re: Speed of Python

2007-09-07 Thread George Sakkis
On Sep 7, 12:42 pm, wang frank [EMAIL PROTECTED] wrote: Is my conclusion correct that Python is slower than matlab? Are there any way to speed it up? Yes, use Numpy for any non trivial number-crunching task: http://numpy.scipy.org/. Even if you don't, you can speed up the original function by

Re: Speed of Python

2007-09-07 Thread Istvan Albert
On Sep 7, 12:42 pm, wang frank [EMAIL PROTECTED] wrote: Is my conclusion correct that Python is slower than matlab? There are ways to speed up code execution, but to see substantial improvement you'll need to use numpy and rework the code to operate on vectors/matrices rather than building the

Re: Speed of Python

2007-09-07 Thread ajaksu
On Sep 7, 2:37 pm, wang frank [EMAIL PROTECTED] wrote: I am not familiar with python, so I just simply try to reproduce the same code in python. Seems almost correct, but from what I guess of MatLab, George's suggestions make it a bit more fair. If you think that my python script is not

Re: Speed of Python

2007-09-07 Thread wang frank
] To: python-list@python.org Subject: Re: Speed of Python Date: Fri, 07 Sep 2007 19:27:45 - On Sep 7, 2:37 pm, wang frank [EMAIL PROTECTED] wrote: I am not familiar with python, so I just simply try to reproduce the same code in python. Seems almost correct, but from what I guess of MatLab

Re: Speed of Python

2007-09-07 Thread wang frank
frank [EMAIL PROTECTED] Subject: Re: Speed of Python Date: Fri, 7 Sep 2007 16:49:05 -0500 On 9/7/07, wang frank [EMAIL PROTECTED] wrote: Hi, Here is the matlab code: function [z]=bench1(n) for i=1:n, for j=1:1000, z=log(j); z1=log(j+1); z2=log(j+2); z3

Re: Speed of Python

2007-09-07 Thread Marc 'BlackJack' Rintsch
On Fri, 07 Sep 2007 22:59:26 +, wang frank wrote: I also have tried to use numpy to speed it up. However, surprisingly, it is slower than the pure python code. Here is the code: import numpy arange=numpy.arange nlog=numpy.log def bench6(n): for i in xrange(n):

Re: Speed of Python

2007-09-07 Thread wang frank
I am just trying to compare the speed with matlab. The arrange is used for another test, that is why it shows up in the mail. Thanks Frank From: Marc 'BlackJack' Rintsch [EMAIL PROTECTED] To: python-list@python.org Subject: Re: Speed of Python Date: 7 Sep 2007 23:17:55 GMT On Fri, 07 Sep

Re: Speed of Python

2007-09-07 Thread Terry Reedy
wang frank [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] |z=log(j); This matlab code is faster in part than your Python equivalent: | z=math.log(m) because of the repeated lookup of log in the math module. So, replace | import math with from

Re: Speed of Python

2007-09-07 Thread Carl Banks
On Sep 7, 12:42 pm, wang frank [EMAIL PROTECTED] wrote: Hi, While comparing the speed of octave and matlab, I decided to do a similar test for python and matlab. The result shows that python is slower than matlab by a factor of 5. It is not bad since octave is about 30 time slower than

Re: Uninstall speed with Python 2.4 MSI

2007-05-19 Thread Martin v. Löwis
David Bolen wrote: I'm in the process of uninstalling 2.4a2 to install 2.4a3 and the uninstall is running absolutely dog slow and burning 100% cpu while doing it (all going to mshta.exe). Watching the progress bar it almost seems to be doing a whole bunch of operations per file or something.

Re: speed of python vs matlab.

2006-12-14 Thread Christophe
Chao a écrit : My Bad, the time used by python is 0.46~0.49 sec, I tried xrange, but it doesn't make things better. import time tic = time.time() a = 1.0 array = range(1000) for i in array: for j in array: a = a + 0.1 toc = time.time() print toc-tic,' has elapsed'

Re: speed of python vs matlab.

2006-12-14 Thread Roberto Bonvallet
Chao wrote: My Bad, the time used by python is 0.46~0.49 sec, I tried xrange, but it doesn't make things better. Actually it does: it doesn't waste time and space to create a big list. -- Roberto Bonvallet -- http://mail.python.org/mailman/listinfo/python-list

Re: speed of python vs matlab.

2006-12-14 Thread bearophileHUGS
Chao, you can also try Psyco, applied on functions, and when necessary using its metaclass too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: speed of python vs matlab.

2006-12-14 Thread Chao
Thank you guys for your interest, I tried two things 1) put code into a function 2) use psyco. 1) by putting them into a function, there is a significant improvement, around 30% the running time will be around 0.3sec 2) by using psyco, it really does a great job, the running time is around

Re: speed of python vs matlab.

2006-12-14 Thread Robert Kern
Chao wrote: While trying this another question comes up, psyco seems to be able to optimize built-in functions user's code, if I call a function from an external library, it seems doesn't help. A simple thing is I placed a = numpy.sin(a) in the loop rather than a = a+1, in this case, psyco

Re: speed of python vs matlab.

2006-12-14 Thread greg
Chao wrote: I did some search, in previous discussion, people has compared python/numpy vs matlab, but it is actually comparison between numpy(which is implemented in c) vs matlab. Yes, matlab is operating on whole arrays at a time, like numpy. So it's not surprising that they have

speed of python vs matlab.

2006-12-13 Thread Chao
I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1 unfortunately, it took 4.5 seconds to finish(my machines is fine. P4 3.0G, 1G RAM, it varies according to

Re: speed of python vs matlab.

2006-12-13 Thread Aidan Steele
On 13 Dec 2006 16:07:20 -0800, Chao [EMAIL PROTECTED] wrote: I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1 unfortunately, it took 4.5 seconds to

Re: speed of python vs matlab.

2006-12-13 Thread Gabriel Genellina
At Wednesday 13/12/2006 21:07, Chao wrote: I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1 unfortunately, it took 4.5 seconds to finish(my machines is

Re: speed of python vs matlab.

2006-12-13 Thread Andrew Sackville-West
On Wed, Dec 13, 2006 at 04:07:20PM -0800, Chao wrote: I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1 unfortunately, it took 4.5 seconds to

Re: speed of python vs matlab.

2006-12-13 Thread Chao
My Bad, the time used by python is 0.46~0.49 sec, I tried xrange, but it doesn't make things better. import time tic = time.time() a = 1.0 array = range(1000) for i in array: for j in array: a = a + 0.1 toc = time.time() print toc-tic,' has elapsed' used by matlab is 0.012sec

Re: speed of python vs matlab.

2006-12-13 Thread Jonathan Curran
On Wednesday 13 December 2006 18:07, Chao wrote: I've been trying to develop some numerical codes with python, however got disappointed. A very simple test, a = 1.0 for i in range(1000): for j in range(1000): a = a+1 unfortunately, it took 4.5 seconds to finish(my