From: Denis Vlasenko Date: Mon, 16 Jul 2007 06:41:54 +0000 (-0700) Subject: vsprintf.c: optimizing, part 1 (easy and obvious stuff) X-Git-Tag: v2.6.23-rc1~798 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b39a734097d5095d63eb9c709a6aaf965633bb01;p=pandora-kernel.git 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 Signed-off-by: Denys Vlasenko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed