Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #16347

Re: Does py2app improves speed?

From Alan Meyer <ameyer2@yahoo.com>
Newsgroups comp.lang.python
Subject Re: Does py2app improves speed?
Date 2011-11-28 15:03 -0500
Organization A noiseless patient Spider
Message-ID <4ED3E901.30306@yahoo.com> (permalink)
References (1 earlier) <CALwzidnD-hP-NQouJtfJLNLOsm7Sp5cZ_AA1cnLWcBUNKpv6AA@mail.gmail.com> <3F9F123B-4A94-46C7-9184-2D0EF7F3A27C@gmail.com> <4ECE48E3.6070701@davea.name> <432E5AEC-F306-4043-B28D-AF4213F0526E@gmail.com> <mailman.3006.1322144862.27778.python-list@python.org>

Show all headers | View raw


On 11/24/2011 9:27 AM, Dave Angel wrote:
...
> Several ways to speed up code.
>
> 1) use language features to best advantage
> 2) use 3rd party libraries that do certain things well
> 3) use best algorithms, subject to #1 and #2
> 4) have someone else review the code (perhaps on the list, perhaps
> within your own organization)
> 5) measure (eg. profile it)
> 6) use optimizing tools, such as pypy or Cython.
> 7) rewrite parts of it in another language
> 8) get a faster processor
> 9) rewrite it all in another language
>
> It takes experience to choose between these, and each project is
> different. But even the most experienced developers will frequently
> guess entirely wrong where the bottleneck is, which is why you measure
> if you care.

I agree that measuring (profiling) is the most critical.

As you say, even the most experienced programmers can guess wrong.  The 
first time I used a profiler a couple of decades ago I was egotistical 
enough to wonder how this thing could help me.  After all, I wrote the 
code.  I knew what it did.  The profiler wasn't going to tell me 
anything I didn't know.

I learned  a little humility after reading the profiler output.  The 
program was spending most of its time in a place that I never dreamed 
was a problem, and a 10 minute fix cut run times in half.

In that particular case there wasn't even a design problem, it was just 
a procedure call inside a tight loop that executed far more often than I 
imagined and could be replaced with a few lines of inline code.

I think the rest of your list is excellent too.

     Alan

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Does py2app improves speed? Dave Angel <d@davea.name> - 2011-11-24 09:27 -0500
  Re: Does py2app improves speed? Alan Meyer <ameyer2@yahoo.com> - 2011-11-28 15:03 -0500
    Re: Does py2app improves speed? Dave Angel <d@davea.name> - 2011-11-28 22:53 -0500

csiph-web