[En-Nut-Discussion] Optimizing nutconf

Thiago A. Corrêa thiago.correa at gmail.com
Tue Jan 6 15:22:17 CET 2009


Hi Ole,

>>    I'm running on a 2.8Ghz Quad, and still takes some 3 seconds to
>> tick a checkbox, wonder how nutconf is doing for others.
>
> I just build the HEAD version of NutConf on my Ubuntu 8.10 machine and
> tried to reproduce your problems. Unfortunately I ended up in a
> segmentation fault just after selecting a configuration file. So it does
> not work at all for me.

I don't think the changes I've commited would cause crashes on any
platform. The attached patch I'm not so sure.
How older is this version that is working for you? I can try to build
nutconf under linux to see... Hopefully it should be easier than
building under win32 :)

> A little older version worked quite ok (despite of some minor problems
> with the interface). Such delays (3s to check a check-box) seem to come
> from anywhere else. Can't believe this has to do with the configuration
> scripts.

Well, I've profiled it, and most of the time is spent in
RefreshComponents(m_repository, m_root); line from bool
CNutConfDoc::SetActive(CConfigItem & item, bool bEnabled). Most of the
top called functions are lua functions as well.
During this time, I get 25% cpu utilization, since this is a quad and
we have no threading. Perhaps your system runs single threaded
programs better (?).

AFAIK linux has way better caching/memory management than Win32,
wonder if that makes for the difference we are seeing here.
Btw, did you try the older nutconf on newer repository? I'm guessing
that as the repository grows, the problem might become more pronounced
since we have lots of O(n) and some O(n^2) algorithms in the lua table
searching functions.

Also, there is a lot of strdup's going on.

Kind regards,
    Thiago A. Correa


More information about the En-Nut-Discussion mailing list