Pavel Machek wrote:
> > [about strtoul]
> > Perhaps I am mistaken but I'd expect it to be called what, ten times at
> > boot time, and a couple of times when X loads the MTRRs?
>
> On second thought, ps -auxl maybe stresses simple_strtoul a little
> bit. Not sure.
Nah. proc_pid_lookup does its
Hi!
> > It seems gcc creates much better code with the variables set to register
> > types.
>
> Curious. GCC should be generating the same code regardless; ah well.
>
> Is strtoul actually used in the kernel other than for the occasional
> (rare) write to /proc/sys and parsing boot options?
>
Hi!
> The following patch is a faster implementation of the simple_strtoul
> function. This function differs from the original in that it reduces the
> multiplies to shifts and logical operations wherever possible. My testing
> shows that it adds around 100 bytes, but is about 6% faster on a K6-2
> On Wed, 20 Dec 2000, Steve Grubb wrote:
>
> > +while (isdigit(c)) {
> > +result = (result*10) + (c & 0x0f);
> > +c = *(++cp);
> > +}
>
> x * 10 can be written as:
>
> (x << 2 + x) <
On Thu, 21 Dec 2000, Matthias Andree wrote:
>
> x * 10 can be written as:
>
> (x << 2 + x) << 1 = (4x+x) * 2
> (x << 3) + (x << 1) = 8x + 2x
Or as "x * 10". Which has the advantage of actually being readable, and
letting the compiler optimize it into one of the other forms if that's
profitable
On Wed, 20 Dec 2000, Steve Grubb wrote:
> +while (isdigit(c)) {
> +result = (result*10) + (c & 0x0f);
> +c = *(++cp);
> +}
x * 10 can be written as:
(x << 2 + x) << 1 = (4x+x) * 2
(
Steve Grubb wrote:
> It seems gcc creates much better code with the variables set to register
> types.
Curious. GCC should be generating the same code regardless; ah well.
Is strtoul actually used in the kernel other than for the occasional
(rare) write to /proc/sys and parsing boot options?
>
Hello,
I continued experimenting with the Test Case and found a further speed
improvement & I am re-submiting the patch. It is the same as the first one
with the two local variables changed to register storage types.
On a K6-2, I now see:
Base 10 - 28% speedup
Base 16 - 24% speedup
Base 8 - 30%
Hello,
I thought about that. This would be my recommendation for glibc where the
general public may be doing scientific applications. But this is the kernel
and there are people that would reject my patch purely on the basis that it
adds precious bytes to the kernel. But since the kernel is "cont
On Wed, Dec 20, 2000 at 09:09:03AM -0500, Steve Grubb wrote:
> Hello,
>
> The following patch is a faster implementation of the simple_strtoul
> function.
[snip]
Why not preserve the existing code for bases other than 8, 10, and 16?
Admittedly, the only other case that is likely to be used would
Hello,
The following patch is a faster implementation of the simple_strtoul
function. This function differs from the original in that it reduces the
multiplies to shifts and logical operations wherever possible. My testing
shows that it adds around 100 bytes, but is about 6% faster on a K6-2. (It
11 matches
Mail list logo