Re: [PATCH v3 1/4] util_macros.h: add find_closest() macro

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

 



On Friday, March 20, 2015, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:

> On Thu, 19 Mar 2015 18:27:41 +0100 Bartosz Golaszewski <
> bgolaszewski@xxxxxxxxxxxx <javascript:;>> wrote:
>
> > Searching for the member of an array closest to 'x' is
> > duplicated in several places.
>
> Linear search is pretty nasty.  lib/bsearch.c could do this
> with a bit of tweaking.  But that's a separate project.


These are short lists, (10 items or less) searched infrequently (perhaps
once or twice) when an lmsensors driver is initialized/configured.

Linear search could be faster under these conditions due to tighter loops
and more predictable memory access pattern with better cache behavior. No?

Phil P.


-- 
Philip Pokorny, RHCE
Chief Technology Officer
PENGUIN COMPUTING, Inc
www.penguincomputing.com

Changing the world through technical innovation
_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors




[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux