> > I noticed that the gcc compiler options in the tarball Makefile were not
> > conducive to speed. There, I tried changing the gcc options to:
> >
> > CFLAGS = -O3 -funroll-loops -fomit-frame-pointer -W -Wall
>
> Thank your for this hint, I changed my Makefile for the production code. However, I
> could not feel any difference between the two options. The real problem is the
> function getcfg(), which gets called many thousand times internally and has to parse
> elogd.cfg each time. Once I implement a hash table for that function, elogd should
> become faster by at least a factor of two.
Yeah - What's up with that?
I have seen this discussed before - Seems like it should be a priority to get this
fixed, as doing a hash table is straightforward, and the speed increase should be pretty
health - there are several c libraries available - check out "man 3 hsearch" for the
POSIX hash table management that already available. Other c library searches that you
could use include bsearch (binary tree), tsearch (tree searching), btree (b+ tree).
However, the easiest and most obvious one to use for elog appears to be a simple hash
table search (hsearch).
Is there something else which is making this difficult to do? |