Re: [Evolution-hackers] GStringChunk - not all it's cracked up to be.



On Fri, 2006-11-03 at 20:00 +0000, Ross Burton wrote:
> On Fri, 2006-11-03 at 14:26 -0500, Jeffrey Stedfast wrote:
> > With these new patches coming in pushing the idea of moving to a
> > GStringChunk here and there, at first it all sounds well and good, but
> > then I looked at the source code to GStringChunk because I had a feeling
> > of how it was implemented and based on that feling, had some bad
> > feelings about how it handled situations that would be extremely likely
> > to cause a more bloated usage of memory than aught be the case.
> 
> Would it be reasonable to hack on GStringChunk stealing relevant bits of
> code from EDS, instead of duplicating similar functionality?

I suppose, the problem is that the GStringChunk API is kind of lacking
so retrofitting a better implementation into the same API might be
difficult.

>   If a patch
> comes with "and this is why it's a vast improvement", it will probably
> get accepted.

No doubt... one could "easily" improve GStringChunk significantly just
by keeping track of how much free space remains in each block. The thing
is that even with that approach, you can still end up wasting a lot of
space if the most string lengths are just slightly larger than half the
size of each block size... and if you choose a block size shorter than
the typical length, then you are simply degenerating into g_strduping
each string AND still getting penalised by tracking overhead.

> 
> Ross
-- 
Jeffrey Stedfast
Desktop Hacker - Novell, Inc.
fejj novell com  - www.novell.com




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]