Re: Small fix in Products.ZCTextIndex, how to go further?
"Charlie Clark" <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Organization | Clark Consulting & Research |
| Message-ID | <[email protected]> |
Am 14.11.2012, 16:26 Uhr, schrieb Hanno Schlichting <[email protected]>: > Hi. > The change looks ok. But I think you broke an optimization. IIRC the code > compares the old and new values for the index, and skips the indexing > step > if they are the same. The typical item.reindexObject() call sents data > for > all indexes, even if just one or two them have changed. The optimization > made sure to skip any extra work, if there wasn't really any change for > the > text index. Without that check, you end up updating and writing a bunch > of > internal data structures in the text index every time. Those lead to > slower > write performance and more conflict errors. > Could you have another look, and see if you can preserve the > optimization? Could we also have a clean up with a specific exception in the try: except: clause? I assume we're expecting an AttributeError? And move filter to a generator expression / list comprehension? I could say for Python 3 compatibility but that doesn't matter so much as there is no easy way for the isinstance(t, basestring) Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a Düsseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226 _______________________________________________ Zope-Dev maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )