[lm-sensors] [RFC PATCH] lib/access.c optimization

Mark M. Hoffman mhoffman at lightlink.com
Thu Jul 27 03:31:12 CEST 2006


Hi again:

* Mark M. Hoffman <mhoffman at lightlink.com> [2006-07-25 00:13:58 -0400]:
> The following patch shaves about 8% off the execution time of 'sensors -u'
> on my workstation (2645586 cycles before vs. 2430821 cycles after).
> 
> Can I please get an ACK on this patch before I commit it?  Thanks.
> 
> Measurement method:
> 	(build/install lm-sensors userspace with DEBUG=1 to get -g)
> 	valgrind --tool=callgrind sensors -u
> 	kcachegrind callgrind.out.NNNN
> 
> 
> Index: lib/access.c

Before anyone spends too much time on that patch... why are there so many
'strcasecmp' calls in libsensors?  Did you know that you can specify 'in0'
or 'IN0' in the config file and both have the same effect?  I never even
realized it until yesterday night.  This case insensitivity is *nowhere*
mentioned in the man pages.

Can we get rid of that?  If so, I'm gonna shave a lot more than 8% by
using a hash for all the string/name to chip/feature/ignore lookups.

BTW: valgrind 3.2.0 (w/ callgrind) plus kcachegrind rocks.

Regards,

-- 
Mark M. Hoffman
mhoffman at lightlink.com




More information about the lm-sensors mailing list