Subject: Re: CVS commit: src/lib/libc/arch/i386/string
To: None <M.Drochner@fz-juelich.de>
From: J.T. Conklin <jtc@acorntoolworks.com>
List: current-users
Date: 02/04/2005 10:40:56
Matthias Drochner <M.Drochner@fz-juelich.de> writes:
> jtc@acorntoolworks.com said:
>> I've been using this code in both libc and libkern without problem
>> since I submitted it.
>
> For libkern I don't consider it _that_ useful. String processing in
> the kernel is minimal. The "worst cpu hog" (strncmp) is around line
> 500 in my profiling output.  Also, these functions get pulled into
> boot code, where size matters a lot.

I thought the boot code used libsa, which has byte-by-byte, "size"
optimized, implementations, but now that I've checked it seems to be
only for the mem* functions.  It might be worth it doing, since each
byte of space is so valuable in boot loaders.

It's true that the kernel doesn't use the str* functions that much.
An interesting experiment would to be use the same technique for
copyinstr and copyoutstr, since those are more commonly used for
userland<->kernel argument passing.

    --jtc

-- 
J.T. Conklin