[Python-Dev] Is there any fun with benchmarks

2011-06-22 Thread anatoly techtonik
I run across a snippet in SCons.Util (don't worry, I've double-checked
To: field) that claims it is faster than os.path.splitext() while
basically doing the same thing.

def splitext(path):
"Same as os.path.splitext() but faster."
sep = rightmost_separator(path, os.sep)
dot = path.rfind('.')
# An ext is only real if it has at least one non-digit char
if dot > sep and not containsOnly(path[dot:], "0123456789."):
return path[:dot],path[dot:]
else:
return path,""

I wonder if upcoming speed.python.org has any means to validate these
claims for different Python releases?
Is there any place where I can upload my two to compare performance?
Are there any instructions how to create such snippets and add/enhance
dataset for them?
Any plans or opinions if that will be useful or not?
--
anatoly t.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is there any fun with benchmarks

2011-06-22 Thread Paul Moore
On 22 June 2011 13:47, anatoly techtonik  wrote:
> I run across a snippet in SCons.Util (don't worry, I've double-checked
> To: field) that claims it is faster than os.path.splitext() while
> basically doing the same thing.

Actually, it doesn't do the same thing. Doesn't handle files like
.profile properly. Also, this one seems to treat numerics differently.
So I'm not sure what you're trying to prove in a comparison...?

Paul.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is there any fun with benchmarks

2011-06-22 Thread Nick Coghlan
On Wed, Jun 22, 2011 at 10:47 PM, anatoly techtonik  wrote:
> I wonder if upcoming speed.python.org has any means to validate these
> claims for different Python releases?
> Is there any place where I can upload my two to compare performance?
> Are there any instructions how to create such snippets and add/enhance
> dataset for them?
> Any plans or opinions if that will be useful or not?

The timeit module handles microbenchmarks on short snippets without
any real problems. speed.python.org is about *macro* benchmarks -
getting a feel for the overall interpreter performance under a variety
of real world workflows.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Is there any fun with benchmarks

2011-06-22 Thread Maciej Fijalkowski
On Wed, Jun 22, 2011 at 3:24 PM, Nick Coghlan  wrote:
> On Wed, Jun 22, 2011 at 10:47 PM, anatoly techtonik  
> wrote:
>> I wonder if upcoming speed.python.org has any means to validate these
>> claims for different Python releases?
>> Is there any place where I can upload my two to compare performance?
>> Are there any instructions how to create such snippets and add/enhance
>> dataset for them?
>> Any plans or opinions if that will be useful or not?
>
> The timeit module handles microbenchmarks on short snippets without
> any real problems. speed.python.org is about *macro* benchmarks -
> getting a feel for the overall interpreter performance under a variety
> of real world workflows.
>
> Cheers,
> Nick.
>

I think the question that timeit doesn't answer and speed potentially
can (I don't know if it should, but that's a matter of opinion) is how
those numbers differ among various interpreters/OSes/versions. This is
something for what you need a special offloaded server support
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PEP 382 sprint

2011-06-22 Thread Barry Warsaw
Hi folks,

Yesterday, 6 Washington DC area Pythonistas met to work on PEP 382.  I wrote
up a summary based on my notes and blogged about it here:

http://www.wefearchange.org/2011/06/pep-382-sprint-summary.html

Hopefully, the other participants will correct my mistakes and fill in the
holes.   A few other things to mention:

 * I resurrected the import-sig in order to shepherd PEP 382 to landing in
   Python 3.3.  If you're at all interested in helping out, please join the
   mailing list:

   http://mail.python.org/mailman/admin/import-sig

* We created a wiki page to track our results, questions, and plan of action:

  http://wiki.python.org/moin/Pep382Sprint

I want to thank my fellow sprint participants for coming out and really doing
a great job working on this.  And I especially want to thank the PSF for
sponsoring our sprint.  What a great way to encourage Python developers to
meet and work on improving Python!

Cheers,
-Barry


signature.asc
Description: PGP signature
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: #1874: detect invalid multipart CTE and report it as a defect.

2011-06-22 Thread Georg Brandl
On 22.06.2011 19:48, r.david.murray wrote:
> http://hg.python.org/cpython/rev/5a2602939d5d
> changeset:   70925:5a2602939d5d
> user:R David Murray 
> date:Wed Jun 22 13:47:53 2011 -0400
> summary:
>   #1874: detect invalid multipart CTE and report it as a defect.
> 
> files:
>   Lib/email/errors.py   |   3 +
>   Lib/email/feedparser.py   |   5 ++
>   Lib/test/test_email/test_email.py |  45 +++
>   Misc/NEWS |   3 +
>   4 files changed, 56 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/Lib/email/errors.py b/Lib/email/errors.py
> --- a/Lib/email/errors.py
> +++ b/Lib/email/errors.py
> @@ -55,3 +55,6 @@
>  
>  class MultipartInvariantViolationDefect(MessageDefect):
>  """A message claimed to be a multipart but no subparts were found."""
> +
> +class InvalidMultipartContentTransferEncodingDefect(MessageDefect):
> +"""An invalid content transfer encoding was set on the multipart 
> itself."""

Dear Mr. Murray,

thank you very much for competing in the PSU's Longest Class Name in the
Standard Library competition.  Unfortunately, your class name of 45 characters
has been surpassed by four other contestants.

However, it is my pleasure to inform you that your entry wins the consolation
prize for the Longest Exception Name!  A framed certificate and a PSU-branded
wooden keyboard will be delivered to you shortly.

Yours sincerely,
the PSU ministry of silly stats


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] cpython: #1874: detect invalid multipart CTE and report it as a defect.

2011-06-22 Thread R. David Murray
On Wed, 22 Jun 2011 21:40:57 +0200, Georg Brandl  wrote:
> On 22.06.2011 19:48, r.david.murray wrote:
> > diff --git a/Lib/email/errors.py b/Lib/email/errors.py
> > --- a/Lib/email/errors.py
> > +++ b/Lib/email/errors.py
> > @@ -55,3 +55,6 @@
> >  
> >  class MultipartInvariantViolationDefect(MessageDefect):
> >  """A message claimed to be a multipart but no subparts were found."""
> > +
> > +class InvalidMultipartContentTransferEncodingDefect(MessageDefect):
> > +"""An invalid content transfer encoding was set on the multipart 
> > itself."""
> 
> Dear Mr. Murray,
> 
> thank you very much for competing in the PSU's Longest Class Name in the
> Standard Library competition.  Unfortunately, your class name of 45 characters
> has been surpassed by four other contestants.
> 
> However, it is my pleasure to inform you that your entry wins the consolation
> prize for the Longest Exception Name!  A framed certificate and a PSU-branded
> wooden keyboard will be delivered to you shortly.

See, there are hidden benefits to following the existing coding
conventions of stdlib modules...

(I initially called it InvalidMultipartCTEDefect, but all of the other
names were spelled out, so)

--
R. David Murray   http://www.bitdance.com
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com