Re: Some performance notes
- From: Tim Janik <timj gtk org>
- To: Johannes Stezenbach <js convergence de>
- Cc: Owen Taylor <otaylor redhat com>, Gtk+ Developers <gtk-devel-list gnome org>
- Subject: Re: Some performance notes
- Date: Wed, 8 Aug 2001 21:05:01 +0200 (CEST)
On Wed, 8 Aug 2001, Johannes Stezenbach wrote:
> Tim Janik wrote:
> >
> > On Mon, 6 Aug 2001, Johannes Stezenbach wrote:
> >
> > > int i;
> > > GObject *obj[10000];
> > > for (i = 0; i < 10000; i++)
> > > obj[i] = g_object_new (G_TYPE_OBJECT, NULL);
> > >
> > > takes about 20 msecs. Not too bad ;-)
> > >
> > > The same using
> > >
> > > obj[i] = g_cim_list_new ();
> > >
> > > takes 700 msecs
>
> > don't let the code's complexity fool you, it's written to handle unlimted
> > numbers of construct and non-construct parameters, however the
> > normal case is none or 1 construct property per object, so that
> > code like:
> > if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
> > {
> ...
> >
> > usually boils down to a NOP.
>
>
> I created a stand-alone test program which shows that either using two
> G_PARAM_CONSTRUCT_ONLY or passing two property arguments to g_object_new()
> slows down object creating by a factor of 16.
> (Creating 100.000 objects takes 1 sec. vs. 16 sec. on my PIII 733.)
>
> I profiled it using gprof and attach relevant excerpts from the
> profile results.
ok, we should really rerun that test after:
1) pspec-pool-lookup indexes by quarks
2) g_object_new_valist eliminated an extra per-property call to
pspec-pool-lookup
3) signal performance was improved
and maybe
4) TypeNode.supers[] became TypeNode* pointers.
currently this profile just confirms that we're slow in areas
where we already know that we're slow and can do better ;)
>
> Regards,
> Johannes
---
ciaoTJ
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]