Dear Alexei, Sheplyakov Alexei schrieb:
On Sat, Aug 19, 2006 at 02:31:30PM +0200, Chris Dams wrote:
The point is of course that every object of a class does only store a *pointer* to a table of virtual methods and not the table itself.
I agree with you, in theory it should be so. But in practice getting rid of [unnecessary] virtual methods *does* help to reduce memory usage. E.g. removing all printing methods (which I use for debugging only, since there is no point in staring throw several-hundreds-megabytes expression, compiling it as a C/C++/whatever code is hopeless too) reduces memory usage by ~10% (and this was extremely important for us due to 3Gb user-space VM limit).
just out of curiosity: do you have an explanation for that phenomenon? I ask, because your observation - which I don't deny - contradicts my common C++ knowledge. Regards, Jens