Re: Some performance notes



Owen Taylor wrote:
> 
> So, without including hard data (I don't have much), here are
> my observations:

I use the GLib type system for non-GUI stuff, and I
recently found out that object creation is quite slow,
i.e. creating thousands of objects takes seconds. Many
seconds on an embedded platform having a 100 MHz ARM.

Enabling mem chunks did not help, and my guess was
that a lot of GValue default property value copying
is going on during g_object_new().
(Which IMHO is unnecessary since each class has an init
function to take care of this more efficiently.)

After I removed the g_object_class_install_property() stuff,
object creation was faster, but is still way to slow compared
to just malloc'ing plain C structs for holding the data.

(Sorry, I have no real benchmarks yet, but one of my test
programs parses a 64K text file and creates 2500 objects
from it. Parsing alone takes 0.25 sec., creating the
objects takes 25 sec. (!) on the 100 MHz ARM (just below
1 sec on a 800 MHz Athlon). I normally prepend the objects
to a GList, commenting out the prepend does not speed it up.)


Do you have any ideas how to speed that up?


Regards,
Johannes




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