diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-07-15 23:41:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 09:05:52 -0700 |
commit | b39a734097d5095d63eb9c709a6aaf965633bb01 (patch) | |
tree | 78afaae4c1229163279b902bacf99445dc16e767 /lib/rwsem.c | |
parent | 4b4e5a1411c8b970983fb6022db1da31c4f5c301 (diff) | |
download | linux-3.10-b39a734097d5095d63eb9c709a6aaf965633bb01.tar.gz linux-3.10-b39a734097d5095d63eb9c709a6aaf965633bb01.tar.bz2 linux-3.10-b39a734097d5095d63eb9c709a6aaf965633bb01.zip |
vsprintf.c: optimizing, part 1 (easy and obvious stuff)
* There is no point in having full "0...9a...z" constant vector,
if we use only "0...9a...f" (and "x" for "0x").
* Post-decrement usually needs a few more instructions, so use
pre decrement instead where makes sense:
- while (i < precision--) {
+ while (i <= --precision) {
* if base != 10 (=> base 8 or 16), we can avoid using division
in a loop and use mask/shift, obtaining much faster conversion.
(More complex optimization for base 10 case is in the second patch).
Overall, size vsprintf.o shows ~80 bytes smaller text section
with this patch applied.
Signed-off-by: Douglas W Jones <jones@cs.uiowa.edu>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/rwsem.c')
0 files changed, 0 insertions, 0 deletions