Not logged in - Log In / Register

Message Representations with __slots__

We have three classes for representing translatable messages and their translations on import/export:

These are close to C struct types: just dumb collections of data, without ORM backing. The VPOExport and VPOTExport ones are old and redundant; we should be using TranslationMessageData instead.

To figure out what's really in these classes, I tried adding __slots__ to them and running the test suite. The branch is lp:~jtv/launchpad/slots.

TranslationMessageData contains:

VPOExport contains:

VPOTExport contains:

On a sidenote, adding __slots__ may improve import/export performance a bit by avoiding Python's massive object-creation overhead, and this proves that it can be done.

Translations/Experiments/MessageRepresentationsWithSlots (last edited 2010-06-21 07:16:03 by jtv)