Re: [PATCH] util: Optimize path_encode

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

 



Kay Sievers wrote:
> On Tue, Oct 21, 2008 at 12:12, Alan Jenkins <alan-jenkins@xxxxxxxxxxxxxx> wrote:
>   
>> strncpy() shows up in profiling.
>> Since we already know the length, use memcpy() instead.
>>
>> Measured 2% _user_ cpu time reduction on EeePC coldplug
>>     
>
> Applied.
>
> Thanks,
> Kay
>   

Ah... just realised it wasn't the normal C string length inefficiency. 
The problem was strncpy() doesn't stop after writing the terminating
NUL; by definition it goes on to zero the entire buffer.

I spy another use of strncpy in udev_device_add_property_from_string(),
which is responsible for another ~1% user cpu time...

BTW I'm still polishing threaded udevd in my spare time.  It has 4
TODOs; I will post it soon anyway, but I need to write a few explanatory
words first.  I have coarse-grained patch descriptions, but there are a
couple of obvious questions I would like to pre-answer :).
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux