login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
August
»
10
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() and put_dec_full()
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Denys Vlasenko
Subject:
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() and put_dec_full()
Date: Monday, August 9, 2010 - 8:17 pm
On Sunday 08 August 2010 21:29, Michal Nazarewicz wrote:
quoted text
> -- Speed -------------------------------------------------------- > orig_put_dec_full : 1.054570 1.356214 1.732636 1.725760 Original > mod1_put_dec_full : 1.000000 1.017216 1.255518 1.116559 > mod3_put_dec_full : 1.018222 1.000000 1.000000 1.000000 Proposed > > orig_put_dec_trunc : 1.137903 1.216017 1.850478 1.662370 Original > mod1_put_dec_trunc : 1.000000 1.078154 1.355635 1.400637 > mod3_put_dec_trunc : 1.025989 1.000000 1.000000 1.000000 Proposed > -- Size --------------------------------------------------------- > orig_put_dec_full : 1.212766 1.310345 1.355372 1.355372 Original > mod1_put_dec_full : 1.021277 1.000000 1.000000 1.000000 > mod3_put_dec_full : 1.000000 1.172414 1.049587 1.049587 Proposed > > orig_put_dec_trunc : 1.363636 1.317365 1.784000 1.784000 Original > mod1_put_dec_trunc : 1.181818 1.275449 1.400000 1.400000 > mod3_put_dec_trunc : 1.000000 1.000000 1.000000 1.000000 Proposed
In my testing on Phenom II the speed gain is smaller, but it is indeed faster. And smaller!
quoted text
> + /* > + * '(x * 0xcccd) >> 19' is an approximation of 'x / 10' that > + * gives correct results for all x < 81920. However, because > + * intermediate result can be at most 32-bit we limit x to be > + * 16-bit. > + * > + * Because of those, we check if we are dealing with a "big" > + * number and if so, we make it smaller remembering to add to > + * the most significant digit. > + */ > + if (q >= 50000) { > + a = '5'; > + q -= 50000;
...
quoted text
> + /* > + * We need to check if q is < 65536 so we might as well check
You meant "need to check if q is < 81920"?
quoted text
> + * if we can just call the _full version of this function. > + */ > + if (q > 9999) > + return put_dec_full(buf, q);
-- vda --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() and ...
, Michal Nazarewicz
, (Sun Aug 8, 12:29 pm)
[PATCHv2 2/3] lib: vsprintf: optimised put_dec() for 32-bi ...
, Michal Nazarewicz
, (Sun Aug 8, 12:29 pm)
[PATCHv2 3/3] lib: vsprintf: added a put_dec() test and be ...
, Michal Nazarewicz
, (Sun Aug 8, 12:29 pm)
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() ...
, Denys Vlasenko
, (Mon Aug 9, 8:17 pm)
Re: [PATCHv2 2/3] lib: vsprintf: optimised put_dec() for 3 ...
, Denys Vlasenko
, (Mon Aug 9, 9:15 pm)
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() ...
, MichaÅ Nazarewicz
, (Tue Aug 10, 12:39 am)
Re: [PATCHv2 2/3] lib: vsprintf: optimised put_dec() for 3 ...
, MichaÅ Nazarewicz
, (Tue Aug 10, 12:42 am)
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() ...
, Denys Vlasenko
, (Tue Aug 10, 9:08 am)
Re: [PATCHv2 2/3] lib: vsprintf: optimised put_dec() for 3 ...
, Denys Vlasenko
, (Tue Aug 10, 9:10 am)
Re: [PATCHv2 1/3] lib: vsprintf: optimised put_dec_trunc() ...
, Michal Nazarewicz
, (Tue Aug 10, 3:42 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ingo Molnar
Re: [PATCH 0/3] v2 Make hierarchical RCU less IPI-happy and add more tracing
Jeremy Fitzhardinge
Re: Linux 2.6.28.10 and Linux 2.6.29.6 XEN Guest Support Broken x86_64 in BUILD
Nick Piggin
Re: [patch] CFS (Completely Fair Scheduler), v2
Gary Hade
Re: [PATCH 0/5][RFC] Physical PCI slot objects
Dave Johnson
Re: expected behavior of PF_PACKET on NETIF_F_HW_VLAN_RX device?
linux-netdev
:
Arnd Bergmann
Re: 64-bit net_device_stats
Stephens, Allan
RE: [PATCH]: tipc: Fix oops on send prior to entering networked mode
frank.blaschka
[patch 3/5] [PATCH] qeth: support z/VM VSWITCH Port Isolation
Wu Fengguang
Re: [PATCH] dm9601: handle corrupt mac address
David Miller
Re: [PATCH net-2.6.24] Fix refcounting problem with netif_rx_reschedule()
git
:
Junio C Hamano
Re: [PATCH] [RFC] add Message-ID field to log on git-am operation
Junio C Hamano
Re: Handling large files with GIT
Karl
Re: [ANNOUNCE] pg - A patch porcelain for GIT
Josh Triplett
Re: [RFC][PATCH 00/10] Sparse: Git's "make check" target
Pierre Habouzit
Re: [PATCH] git-daemon: more powerful base-path/user-path settings, using formats.
git-commits-head
:
Linux Kernel Mailing List
MIPS: RBTX4939: Fix IOC pin-enable register updating
Linux Kernel Mailing List
regulator: update email address for Liam Girdwood
Linux Kernel Mailing List
[SCSI] ipr: add message to error table
Linux Kernel Mailing List
powerpc/32: Wire up the trampoline code for kdump
Linux Kernel Mailing List
USB: omap_udc: sync with OMAP tree
openbsd-misc
:
Josh Grosse
Re: error : pkg add phpMyAdmin
Brian Candler
Re: OBSD's perspective on SELinux
Jacob Meuser
Re: /dev/audio: Device busy
David Vasek
Re: Inexpensive, low power, "wall wart" computer
William Boshuck
Re: Richard Stallman...
Colocation donated by:
Syndicate