Re: Performance of int/long in Python 3

2013-03-26 Thread rurpy
On Tuesday, March 26, 2013 6:00:43 PM UTC-6, Ned Deily wrote: In article kit1kg$g2u$1...@ger.gmane.org, Mark Lawrence breamore...@yahoo.co.uk wrote: But you are an idiot. I repeat the friendly reminder I posted a few weeks ago and I'll be a little less oblique: please avoid gratuitous

Performance of int/long in Python 3

2013-03-25 Thread Chris Angelico
The Python 3 merge of int and long has effectively penalized small-number arithmetic by removing an optimization. As we've seen from PEP 393 strings (jmf aside), there can be huge benefits from having a single type with multiple representations internally. Is there value in making the int type

Re: Performance of int/long in Python 3

2013-03-25 Thread Ethan Furman
On 03/25/2013 02:51 PM, Chris Angelico wrote: Python 3's int is faster than Python 2's long, but slower than Python 2's int. So the question really is, would a two-form representation be beneficial, and if so, is it worth the coding trouble? I'm inclined to say it's not worth the trouble. If

Re: Performance of int/long in Python 3

2013-03-25 Thread Dan Stromberg
On Mon, Mar 25, 2013 at 4:35 PM, Cousin Stanley cousinstan...@gmail.comwrote: Chris Angelico wrote: The Python 3 merge of int and long has effectively penalized small-number arithmetic by removing an optimization. The cost is clear. I thought I heard that Python 3.x will

Re: Performance of int/long in Python 3

2013-03-25 Thread Cousin Stanley
Chris Angelico wrote: The Python 3 merge of int and long has effectively penalized small-number arithmetic by removing an optimization. The cost is clear. The cost isn't quite as clear under Debian Wheezy here Stanley C. Kitching Debian Wheezy python inline

Re: Performance of int/long in Python 3

2013-03-25 Thread Steven D'Aprano
On Mon, 25 Mar 2013 16:16:05 -0700, Ethan Furman wrote: On 03/25/2013 02:51 PM, Chris Angelico wrote: Python 3's int is faster than Python 2's long, but slower than Python 2's int. So the question really is, would a two-form representation be beneficial, and if so, is it worth the coding

Re: Performance of int/long in Python 3

2013-03-25 Thread Chris Angelico
On Tue, Mar 26, 2013 at 11:17 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Also, speaking as somebody who remembers a time when ints where not automatically promoted to longs (introduced in, Python 2.2, I think?) let me say that having a single unified int type is

Re: Performance of int/long in Python 3

2013-03-25 Thread Oscar Benjamin
On 26 March 2013 00:17, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 25 Mar 2013 16:16:05 -0700, Ethan Furman wrote: [snip] If you're working with numbers, and speed is an issue, you really should be using one of the numeric or scientific packages out there. [snip]

Re: Performance of int/long in Python 3

2013-03-25 Thread Roy Smith
In article 5150e900$0$29998$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Also, speaking as somebody who remembers a time when ints where not automatically promoted to longs (introduced in, Python 2.2, I think?) let me say that having a

Re: Performance of int/long in Python 3

2013-03-25 Thread Steven D'Aprano
On Mon, 25 Mar 2013 20:55:03 -0400, Roy Smith wrote: In article 5150e900$0$29998$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Also, speaking as somebody who remembers a time when ints where not automatically promoted to longs (introduced

<    1   2   3