Jeremy Hylton wrote: > The big change is the coercion work being done in binary_op1(), which > tries to turn strings into numbers in a variety of ways. BINARY_ADD > calls PyNumber_Add(), which calls binary_op1(). When the binary_op1() > calls fails, it then tries sequence concatenation. > > If it were possible for binary_op1() to fail quickly for non-numeric > sequences like strings, we would not see the slowdown for small string > operations. (I believe that's what the silly little benchmark shows > and what one of the pybench tests shows.) I had a patch that did this: * Added an ordinal number to some builtin types. All other types had ordinal 0. * Built a 2-D table of binary methods. * Had operations like PyNumber_Add look into this table and use the method there. It turned out to not give much of a speedup but I think the idea is interesting. Neil
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4