Newsgroups: linux.debian.devel
From: Vincent Lefevre <vinc...@vinc17.net>
Date: Thu, 26 Jul 2012 02:40:02 +0200
Local: Wed, Jul 25 2012 8:40 pm
Subject: Re: glibc very old
On 2012-07-26 03:58:33 +0900, Miles Bader wrote:
> Vincent Lefevre <vinc...@vinc17.net> writes:
I can reproduce a 3.4x slowdown with:
> >> So... these functions were made almost an order of magnitude slower > >> in the (overwhelmingly) common case, in order to handle rare and > >> exceptional cases...? > > This depends on the processor. You should get a processor that
> It's about 5 times slower on both phenom2 (AMD) and core2 (Intel)
#include <stdio.h>
int main (void)
for (i = 0; i < 100000000; i++)
}
and Debian's glibc and Intel Core 2 Duo. I'll try to have more
information about why the processor doesn't detect that the rounding mode doesn't change. But with:
#include <stdio.h>
int main (void)
for (i = 0; i < 100000000; i++)
}
I only get a 9% slowdown. I suppose that withing glibc code, it can
be lower. The advantage of this method compared to remembering the rounding mode in glibc is that it is 100% safe, in case the user or some library bypasses the C libary to change the rounding mode. I think that there could be an optimization like that in
> Ok, I guess there's no really guaranteed way to make it fast, so
Yes, the chosen method could depend on the processor.
> glibc's method (with arch-specific reimplementations for those cases > where it proves to be slow) it is reasonable enough ... -- -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||