|
Some questions -
Did you try a profiler? - you can break the casechg() function into single line functions
and see where the resources go, if you want to see.
Is it worth the compare, on average, to skip zero-length strings? The while(*p)
actually does this, but later on.
Since most of the time is spent stepping through the string one 8 bit character at a time, is it feasible to process sixteen bits or 32 bits at a time? -- since this is where the sample algorithm spends it's time. Right? If you knew the average string length
the "real world" passes in, then maybe you could make a guess as to whether to pursue this 16 32 bit thing.
In about 2 weeks I'm gonna put up a memchr algorithm that deals with this very problem - 8 vs 16 vs 32.
|