[Python-Dev] Subclassing varying length types (What's a PyStructSequence ?)

Mark Hammond MarkH@ActiveState.com
Sun, 2 Dec 2001 11:52:47 +1100

> I only think that nowadays, the trade-off "more flexibility vs.
> memory consumption" leans more towards the former than the latter.
> Not only because memory is cheap, but also because more flexibility
> tends to result in use of better algorithms and these can lead to
> better overall performance and lower total memory use.

This tends to sound great - until you have a large app that is consuming too
many MBs :)

Mozilla's use of strings is fascinating.  They have a very complex C++
string API - all aimed at being as space-optimized as possible.  They go to
huge lengths to avoid string copies and extra allocation at the expense of
an API nobody understands :)

The point is that for fundamental types (including Unicode), medium size
apps may use millions of these objects. Everything we can do to optimize
their speed and size is beneficial.