Issue1492860
Created on 2006-05-22 11:43 by jafo, last changed 2009-04-29 09:18 by mark.dickinson.
|
msg54813 - (view) |
Author: Sean Reifschneider (jafo) |
Date: 2006-05-22 11:43 |
|
At the Need for Speed sprint, Tim Peters asked if
anyone had any need for integer bit operation
performance improvement. Apparently, it's easy to
improve, but nobody has said they need this. Please
reply to this task if you have an application which
needs this.
|
|
msg54814 - (view) |
Author: Tim Peters (tim_one) |
Date: 2006-05-22 12:29 |
|
Logged In: YES
user_id=31435
Changed Category to Performance. The idea with this one is
that the eval loop could easily inline "int & int", "int |
int", "int ^ int", much as it inlines "int + int" today.
|
|
msg83937 - (view) |
Author: Mark Dickinson (mark.dickinson) |
Date: 2009-03-21 15:51 |
|
To see what Tim's talking about here, see the 'big switch' ("switch
opcode") in function PyEval_EvalFrameEx in Python/ceval.c, and look at the
"case BINARY_ADD" bit. Inlining the bitwise operators should be even
easier, since there are no overflow worries. (We do have to assume that C
longs are two's-complement with no trap representation, but
Objects/intobject.c does that already, so it's probably okay.)
This only applies to 'short' integers, so I don't think it's relevant for
Python 3.x.
|
|
msg86584 - (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2009-04-26 01:08 |
|
There's a related patch in issue 1087418.
|
|
msg86678 - (view) |
Author: Mark Dickinson (mark.dickinson) |
Date: 2009-04-27 16:42 |
|
I agree issue 1087418 is related, but why is it marked as a dependency for
this issue? It seems to me that either of these feature requests could be
implemented independently of the other: this one applies only to 2.x
ints, while issue 1087418 applies only to 2.x longs and 3.x ints.
|
|
msg86754 - (view) |
Author: Daniel Diniz (ajaksu2) |
Date: 2009-04-28 17:26 |
|
Mark: it was just my cluelessness showing :)
|
|
msg86768 - (view) |
Author: Antoine Pitrou (pitrou) |
Date: 2009-04-28 21:52 |
|
I don't think it's a good thing to special-case bitwise operations in
the ceval loop. It will make the whole thing less instruction
cache-friendly, just for the purpose of speeding up some very uncommon
operations.
|
|
msg86787 - (view) |
Author: Mark Dickinson (mark.dickinson) |
Date: 2009-04-29 09:18 |
|
It looks like no-one sees this as a useful optimization; it seems even
less useful now given that it's not applicable to Python 3.x.
Closing.
|
|
| Date |
User |
Action |
Args |
| 2009-04-29 09:18:16 | mark.dickinson | set | status: open -> closed resolution: rejected messages:
+ msg86787
|
| 2009-04-28 21:52:52 | pitrou | set | nosy:
+ pitrou messages:
+ msg86768
|
| 2009-04-28 17:26:18 | ajaksu2 | set | dependencies:
- long int bitwise ops speedup (patch included) messages:
+ msg86754 |
| 2009-04-27 16:42:47 | mark.dickinson | set | messages:
+ msg86678 |
| 2009-04-26 01:08:53 | ajaksu2 | set | nosy:
+ ajaksu2 dependencies:
+ long int bitwise ops speedup (patch included) messages:
+ msg86584
|
| 2009-03-21 15:51:59 | mark.dickinson | set | keywords:
+ easy
stage: test needed -> needs patch messages:
+ msg83937 versions:
- Python 3.1 |
| 2009-03-21 15:05:22 | mark.dickinson | set | nosy:
+ mark.dickinson
|
| 2009-03-21 02:47:09 | ajaksu2 | set | stage: test needed versions:
+ Python 3.1, Python 2.7 |
| 2008-03-16 21:07:08 | georg.brandl | set | type: feature request -> performance |
| 2006-05-22 11:43:04 | jafo | create | |
|