Re: gobject n_preallocs
- From: Tim Janik <timj gtk org>
- To: tom <tom dbservice com>
- Cc: Owen Taylor <otaylor gtk org>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: gobject n_preallocs
- Date: Sun, 19 Jan 2003 03:12:28 +0100 (CET)
On Thu, 16 Jan 2003, Owen Taylor wrote:
>
> tom <tom dbservice com> writes:
>
> > i made a improved test... (file below)
> >
> > with n_prealloc = 1000:
> > created: ~200000
> > freed: ~1500
> >
> > and n_prealloc = 0:
> > created: ~150000
> > freed: ~1500
> >
> > if you look at this you see that setting n_prealloc even decreases
> > performance...
>
> Nothing very unexpected about this. n_preallocs makes GObject
> use GMemChunk, and normal malloc is known to be faster than
> GMemChunk
right, assuming glibcs malloc implementation, using GMemChunk is
actually a complicated way of saying "i want to waste a bit of
performance and a lot of memory" and GType's n_prealloc enables
that for object allocations.
> except on systems with highly broken malloc()
> implementions.
owen, what's your take on ignoring the memchunk implementation once
we detected glibc, and simply revert to malloc/free in that case?
we'll have to keep an extra list of things to free upon
memchunk destruction, but that's still much better than the
current wastefull aproach.
>
> Regards,
> Owen
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]