Re: Camel mmap summary ideas, proposal for a meeting

Philip Van Hoof <[email protected]>
Newsgroups gmane.comp.gnome.evolution.devel
Message-ID <[email protected]>
On Wed, 2006-07-12 at 17:19 -0400, Jeffrey Stedfast wrote:
> On Wed, 2006-07-12 at 20:05 +0200, Philip Van Hoof wrote:
 
> > -- Oh by the way. There's a huge amount of "Re: " strings in my memory
> > at this moment. We can probably improve that too ;-) --
> 
> Yea, I've been wanting to overlap strings in such a way as to allow "Re:
> my subject string" and "my subject string" to re-use the same memory.
> Not sure the complexity of this would be worth the (likely very small)
> memory savings tho

Just some idea dumping ...

Using GSList is going to introduce 8 bytes per node (the next and the
data pointer, right?) on x86. So not a good option imo.

If you store an offset-pointer you might get away with a few per such
chunk. For example ([offset] is a pointer to for example a GString str
pointer and [x] is a 7 bit encoded integer, like the pstring length):

[offset]ingtestRe: 

Then "Re: testing" would be stored like [7][3][0] and the component that
at some moment in time wants the string (for example the ETable) will
get a copy of the string from a method that using [offset] reconstructs
the string. That component will of course have to g_free() it itself.

> but at worst, using a single strtab would be nice even if "Re: ..." and
> "..." didn't overlap.


-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.