[issue10725] Better cache instrumentation

2010-12-17 Thread Raymond Hettinger
New submission from Raymond Hettinger rhettin...@users.sourceforge.net: Nick, can you look at this? -- assignee: ncoghlan components: Library (Lib) files: sized_cache.diff keywords: patch messages: 124194 nosy: ncoghlan, rhettinger priority: normal severity: normal status: open title:

[issue10725] Better cache instrumentation

2010-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: The _total_size thing looks like a wildly bad idea to me, since it's so poorly defined (and relying on a couple of special cases). Also, currsize is quite bizarre. Why not simply size? -- nosy: +pitrou

[issue10725] Better cache instrumentation

2010-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Updated to use ABCs but still relies on user objects implementing __sizeof__. So it is accurate whenever sys.getsizeof() is accurate. -- Added file: http://bugs.python.org/file20095/sized_cache2.diff

[issue10725] Better cache instrumentation

2010-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Another thing to work out: not double counting duplicate objects: [1000, 2000, 3000] is bigger than [None, None, None] -- priority: normal - low ___ Python tracker

[issue10725] Better cache instrumentation

2010-12-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated to use ABCs but still relies on user objects implementing __sizeof__. So it is accurate whenever sys.getsizeof() is accurate. I'm really -1 on this. It's better to give no measurement than to give a totally wrong indication. The fact

[issue10725] Better cache instrumentation

2010-12-17 Thread Raymond Hettinger
Changes by Raymond Hettinger rhettin...@users.sourceforge.net: Removed file: http://bugs.python.org/file20095/sized_cache2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10725 ___

[issue10725] Better cache instrumentation

2010-12-17 Thread Nick Coghlan
Nick Coghlan ncogh...@gmail.com added the comment: Indeed, getsizeof() on containers only gives the amount of memory consumed by the container itself (this can be difficult to figure out externally for potentially sparse containers like dicts), but leaves the question of the size of the

[issue10725] Better cache instrumentation

2010-12-17 Thread Raymond Hettinger
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Closed due to lack of interest. -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10725