"Martin v. Loewis" wrote: > > > I thinking of extending the __getitem__ hook to accept slice objects > > Please have a look at > > http://sourceforge.net/tracker/?func=detail&aid=459235&group_id=5470&atid=105470 > > It's a known problem, but Guido won't fix it anytime soon. So I guess > contributions are welcome. Good to know, thanks. > > Looking through the code for '==' the optimization for 'a == a' > > seems too far down the call stack. Since interning strings makes > > this case rather common, I'd suggest to lift the optimization into > > the ceval loop > > As with all optimizations: Patches to just improve the performance are > unacceptable unless accompanied by some hard numbers to show that they > really do have the desired effect. > > History shows that patches to just improve the performance may be > unacceptable even if accompanied by such numbers. Normally, Tim will > construct a scenario where the patch causes a slow-down, and argue > that this is a common scenario :-) Sounds like you have experience ;-) As with all micro-optimizations, the win usually only shows up in some applications. The one I'm writing uses lot's of if tagtype == 'starttag': if tagtype == 'endtag': ... Since the 'starttag' and 'endtag' strings are interned and I'm also interning the strings which are stored in tagtype, I'd like to benefit from the fact that the compare will actually work as 'is'-compare. However, I don't want to use 'is' because I consider interning only an optimization and not a feature of the language. That's why I would like the simple if (v == w) return 0; integrated into the ceval loop right along the INT-compare optimization. This may also help in some other situations where objects are shared. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
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