Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
Subject: Re: sin() on alpha.
Date: 1998/05/23	[thread overview]
Message-ID: <m3som1qs90.fsf@fred.muc.de> (raw)
In-Reply-To: 6k5od1$1b7$1@palladium.transmeta.com


torvalds@transmeta.com (Linus Torvalds) writes:
> 
> Remember: if you can make a small and simple routine that avoids one
> cache miss, that one cache miss is often more costly than the cost of
> the whole routine. This is less true of more complex functions like
> sin() and cos(), but it's still something that is easily overlooked,
> because when you write the routines you tend to test performance by
> having something like
> 
> 	for (i = 0; i < 100000000; i++) {
> 		sum += sin(x); x += 0.00001;
> 	}
> 
> or similar where the cache will be warm all the time.

If you want a good example for this sin look at glibc's source in 
stdio-common/_itoa.c 

It really shows how to _not_ do it. 

-Andi



  reply	other threads:[~1998-05-23  4:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-05-22  4:00 sin() on alpha Dong-Woon Park
1998-05-22  4:00 ` Bruce Allen
1998-05-22  4:00   ` Greg Lindahl
1998-05-23  4:00   ` Christopher Browne
1998-05-23  4:00     ` Michal Jaegermann
1998-05-23  4:00     ` Linus Torvalds
1998-05-23  4:00       ` Andi Kleen [this message]
1998-05-23  4:00       ` Greg Lindahl
1998-05-24  4:00         ` sin() on alpha / Cray libm Joachim Wesner
1998-05-23  4:00   ` sin() on alpha Dong-Woon Park
1998-05-23  4:00     ` Bruce Allen
1998-05-24  4:00       ` Joachim Wesner
1998-05-24  4:00     ` Joachim Wesner
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox