On 14 Feb, 19:41, Steve Howell wrote:
>
> I ditto the profiling recommendation.
>
> http://docs.python.org/library/profile.html
(To the original inquirer...) Try this, too:
http://wiki.python.org/moin/PythonSpeed/Profiling
If you have the tools, it's a lot easier than scanning through tables
of
On Feb 15, 1:07 am, Steve Howell wrote:
> On Feb 14, 11:52 am, Mark Dickinson wrote:
>
>
>
>
>
> > On Feb 14, 4:53 pm, mukesh tiwari
> > wrote:
>
> > > Hello everyone. I am new to python and previously i did programming in
> > > c/c++.Could some one please help me to improve the run time for thi
On Feb 14, 11:52 am, Mark Dickinson wrote:
> On Feb 14, 4:53 pm, mukesh tiwari
> wrote:
>
> > Hello everyone. I am new to python and previously i did programming in
> > c/c++.Could some one please help me to improve the run time for this
> > python program as i don't have idea how to optimized th
On Feb 14, 4:53 pm, mukesh tiwari
wrote:
> Hello everyone. I am new to python and previously i did programming in
> c/c++.Could some one please help me to improve the run time for this
> python program as i don't have idea how to optimized this code.This
> code also seems to be more unpythonic so
On Feb 14, 6:03 pm, a...@pythoncraft.com (Aahz) wrote:
> In article
> <363498c7-3575-4f1e-ad53-d9cd10c8d...@q16g2000yqq.googlegroups.com>,
> Mark Dickinson wrote:
>
> >(2) Obvious things: use range rather than xrange in your loops.
>
> Um, what? You meant the reverse, surely?
Er, yes I did.
On Feb 14, 9:48 am, Mark Dickinson wrote:
> On Feb 14, 4:53 pm, mukesh tiwari
> wrote:
>
> > Hello everyone. I am new to python and previously i did programming in
> > c/c++.Could some one please help me to improve the run time for this
> > python program as i don't have idea how to optimized thi
In article <363498c7-3575-4f1e-ad53-d9cd10c8d...@q16g2000yqq.googlegroups.com>,
Mark Dickinson wrote:
>
>(2) Obvious things: use range rather than xrange in your loops.
Um, what? You meant the reverse, surely?
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
On Feb 14, 4:53 pm, mukesh tiwari
wrote:
> Hello everyone. I am new to python and previously i did programming in
> c/c++.Could some one please help me to improve the run time for this
> python program as i don't have idea how to optimized this code.
> [...]
How much of a speedup do you need? Ar
mukesh tiwari wrote:
Hello everyone. I am new to python and previously i did programming in
c/c++.Could some one please help me to improve the run time for this
python program as i don't have idea how to optimized this code.This
code also seems to be more unpythonic so how to make it look like mo
Hello everyone. I am new to python and previously i did programming in
c/c++.Could some one please help me to improve the run time for this
python program as i don't have idea how to optimized this code.This
code also seems to be more unpythonic so how to make it look like more
pythonic . I am tryi
Paul Rubin wrote:
> "Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
>
>>And if only the html-parsing is slow, you might consider creating an
>>extension for that. Using e.g. Pyrex.
>
>
> I just tried using BeautifulSoup to pull some fields out of some html
> files--about 2 million files, output o
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes:
> And if only the html-parsing is slow, you might consider creating an
> extension for that. Using e.g. Pyrex.
I just tried using BeautifulSoup to pull some fields out of some html
files--about 2 million files, output of a web crawler. It parsed very
John Nagle wrote:
> Diez B. Roggisch wrote:
>> Regardless of the possibility of speeding it up - why should one want
>> this? Coding speed is more important than speed of coding in 90%+ of all
>> cases.
>
> When you have to start buying more servers for the server farm,
> it's a real pain.
On Jun 10, 6:43 pm, John Nagle <[EMAIL PROTECTED]> wrote:
> Josiah Carlson wrote:
> > Steven D'Aprano wrote:
>
> >> On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
>
> >>> the only thing that optimization currently does in Python at present
> >>> is to discard docstrings
>
> >> Python, or
--- John Nagle <[EMAIL PROTECTED]> wrote:
>
> When you have to start buying more servers for
> the server farm,
> it's a real pain. I'm actually facing that because
> Python's HTML
> parsing is so slow.
>
I have been following this thread for a bit, but
apologies in advance if I didn't rea
Diez B. Roggisch wrote:
> Regardless of the possibility of speeding it up - why should one want
> this? Coding speed is more important than speed of coding in 90%+ of all
> cases.
When you have to start buying more servers for the server farm,
it's a real pain. I'm actually facing that be
>It's hard to optimize Python code well without global analysis.
> The problem is that you have to make sure that a long list of "wierd
> things", like modifying code or variables via getattr/setattr, aren't
> happening before doing significant optimizations. Without that,
> you're doomed to a
John Nagle wrote:
> Josiah Carlson wrote:
[snip]
>> Constant folding happens regardless of optimization level in current
>> Pythons.
>
>> So really, assert and docstring removals. Eh.
>
>It's hard to optimize Python code well without global analysis.
> The problem is that you have to make s
--- Kay Schluehr <[EMAIL PROTECTED]> wrote:
> On Jun 11, 12:43 am, Steve Howell
> <[EMAIL PROTECTED]> wrote:
>
> > To the extent that some of these optimizations
> could
> > be achieved by writing better Python code, it
> would
> > nice for optimization tools to have a "suggest"
> mode.
>
> Is
> Is anyone out there who uses MS Word and doesn't deactivate
> the "suggest" mode i.e. Clippy?
Me... I don't install Clippy (or any of his horribly annoying friends)
to start with. :)
On the topic though, the suggest mode of the MS help system is generally
way off-base, even for my 80-yr-old gr
On Jun 11, 12:43 am, Steve Howell <[EMAIL PROTECTED]> wrote:
> To the extent that some of these optimizations could
> be achieved by writing better Python code, it would
> nice for optimization tools to have a "suggest" mode.
Is anyone out there who uses MS Word and doesn't deactivate the
"sugges
Steve Howell wrote:
> --- John Nagle <[EMAIL PROTECTED]> wrote:
>
>>With this, the heavy optimizations are possible.
>>Strength reduction. Hoisting
>>common subexpressious out of loops. Hoisting
>>reference count updates out of
>>loops. Keeping frequently used variables in
>>registers. And el
--- John Nagle <[EMAIL PROTECTED]> wrote:
>
> With this, the heavy optimizations are possible.
> Strength reduction. Hoisting
> common subexpressious out of loops. Hoisting
> reference count updates out of
> loops. Keeping frequently used variables in
> registers. And elimination of
> many u
Josiah Carlson wrote:
> Steven D'Aprano wrote:
>
>> On Sat, 09 Jun 2007 22:52:32 +, Josiah Carlson wrote:
>>
>>> the only thing that optimization currently does in Python at present
>>> is to discard docstrings
>>
>>
>> Python, or at least CPython, does more optimizations than that. Aside
>>
Neal Becker wrote:
> One possible way to improve the situation is, that if we really believe
> python cannot easily support such optimizations because the code is too
> "dynamic", is to allow manual annotation of functions. For example, gcc
> has allowed such annotations using __attribute__ for qu
One possible way to improve the situation is, that if we really believe
python cannot easily support such optimizations because the code is too
"dynamic", is to allow manual annotation of functions. For example, gcc
has allowed such annotations using __attribute__ for quite a while. This
would al
[Neal Becker]
> >>I don't know to what extent these kind of optimizations are
available to
> >>cpython. For example, are constant calculations removed from loops?
[Brett Cannon]
> > If you mean ``2+3``, then yes.
[Greg Ewing]
> Actually, no. Constant folding *could* be done, but it currently
i
Brett Cannon wrote:
>>I don't know to what extent these kind of optimizations are available to
>>cpython. For example, are constant calculations removed from loops?
>
> If you mean ``2+3``, then yes.
Actually, no. Constant folding *could* be done, but it currently isn't:
>>> def f():
... re
On 9/15/05, Neal Becker <[EMAIL PROTECTED]> wrote:
> I use cpython. I'm accustomed (from c++/gcc) to a style of coding that is
> highly readable, making the assumption that the compiler will do good
> things to optimize the code despite the style in which it's written. For
> example, I assume con
Reinhold Birkenfeld wrote:
> David Wilson wrote:
>> For the most part, CPython performs few optimisations by itself. You
>> may be interested in psyco, which performs several heavy optimisations
>> on running Python code.
>>
>> http://psyco.sf.net/
>>
I might be, if it supported x86_64, but AFA
Reinhold Birkenfeld <[EMAIL PROTECTED]> writes:
> David Wilson wrote:
>> For the most part, CPython performs few optimisations by itself. You
>> may be interested in psyco, which performs several heavy optimisations
>> on running Python code.
>>
>> http://psyco.sf.net/
>>
>> Defining a function
David Wilson wrote:
> For the most part, CPython performs few optimisations by itself. You
> may be interested in psyco, which performs several heavy optimisations
> on running Python code.
>
> http://psyco.sf.net/
>
> Defining a function inside a loop in CPython will cause a new function
> objec
For the most part, CPython performs few optimisations by itself. You
may be interested in psyco, which performs several heavy optimisations
on running Python code.
http://psyco.sf.net/
Defining a function inside a loop in CPython will cause a new function
object to be created each and every time
Hi Neal,
I don't believe that cpython currently does any of the optimizations you refer to below. That said, it is very reasonable to adopt "a style of coding that is highly readable, making the assumption that the compiler will do good things" when coding in Python. Python is one of the most h
I use cpython. I'm accustomed (from c++/gcc) to a style of coding that is
highly readable, making the assumption that the compiler will do good
things to optimize the code despite the style in which it's written. For
example, I assume constants are removed from loops. In general, an entity
is de
35 matches
Mail list logo