objectIds vs. objectValues vs. objectItems
Does anybody with profound knowledge of Zope in details know the difference between: - objectIds() - objectValues() - objectItems() I only know what they do. Sometimes I use objectIds() instead of the "richer" objectValues() because I think that only the Ids will be faster to find for the method. Does that make sense? Peter
Does anybody with profound knowledge of Zope in details know the difference between:
- objectIds()
- objectValues()
- objectItems()
I only know what they do. Sometimes I use objectIds() instead of the "richer" objectValues() because I think that only the Ids will be faster to find for the method. Does that make sense?
It makes sense. The goal of that API is to abstract the details of how / where the sub-objects are stored. The current implementation is not that efficient, so I doubt that one would be perceptibly faster than the other for a standard ObjectManager (though there could be quite a difference in another kind of implementation, for example an ObjectManager implemented over a relational table). Brian Lloyd brian@digicool.com Software Engineer 540.371.6909 Digital Creations http://www.digicool.com
Use the source luke. http://www.zopezen.org/ZopeZen/Source/lib/python/OFS/%7eObjectManager.py#362 An object manager (folder) maintains a list of the sub objects it has. objectIds - a list of those objects, fastest objectValues - returns each object from the list in objectIds, meaning its slower than objectIds, but more info. objectItems - returns a set of pairs of id and object, kind of like the first two rolled into one. Cheers. -- Andy McKay. ----- Original Message ----- From: "Peter Bengtsson" <mail@peterbe.com> To: <zope@zope.org> Sent: Wednesday, July 25, 2001 6:17 AM Subject: [Zope] objectIds vs. objectValues vs. objectItems
Does anybody with profound knowledge of Zope in details know the difference between:
- objectIds()
- objectValues()
- objectItems()
I only know what they do. Sometimes I use objectIds() instead of the "richer" objectValues() because I think that only the Ids will be faster to find for the method. Does that make sense?
Peter
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Andy McKay -
Brian Lloyd -
Peter Bengtsson