This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Split mantissa calculation loop and add branch predictionto mp multiplication
- From: Andreas Jaeger <aj at suse dot com>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 31 Dec 2012 11:26:08 +0100
- Subject: Re: [PATCH] Split mantissa calculation loop and add branch predictionto mp multiplication
- References: <20121231092850.GA21621@spoyarek.pnq.redhat.com>
On 12/31/2012 10:28 AM, Siddhesh Poyarekar wrote:
Hi,
The loop inside __mul in mpa.c is slow because of the branch
evaluation within the loop. Attached patch splits the loop to make
the loop simpler to evaluate and also adds some branch prediction to
improve performance. I have verified that this does not break the
testsuite.
I checked for performance improvement with this patch using the test
program here:
http://entropymine.com/imageworsener/slowpow/
with the following commandline:
time ./powtest 1000000 1.0000000000000020 1.5000000000500000
Taking into account the best times with and without the patch (with
more than 10 runs each), the improvement is about a quarter of a
second.
What's the percentage? 0.25s can be a lot - or very little depending on
the total run time.
Andreas
--
Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn,Jennifer Guild,Felix Imendörffer,HRB16746 (AG Nürnberg)
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126