public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [patch] pow.3: Add note on performance characteristics of pow
@ 2014-10-16 23:52 Manuel López-Ibáñez
  2014-10-17  5:24 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-16 23:52 UTC (permalink / raw)
  To: mtk.manpages, linux-man; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 546 bytes --]

Hello,

This patch documents
https://sourceware.org/bugzilla/show_bug.cgi?id=13932 as requested in
https://sourceware.org/bugzilla/show_bug.cgi?id=15267. It would be
nice to add more details, but it seems the behavior and its
consequences is not well understood. The purpose of the note is to
warn users of this behavior and thus avoid frustration
(http://entropymine.com/imageworsener/slowpow/).

This is my first patch. I followed (hopefully correctly) the instructions here:
https://www.kernel.org/doc/man-pages/patches.html

Cheers,

Manuel.

[-- Attachment #2: pow.diff --]
[-- Type: text/plain, Size: 562 bytes --]

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..3d2151a 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,17 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some inputs than for other nearby
+inputs. The inputs that produce such behavior are different for
+.BR powf (),
+.BR pow ()
+and
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-16 23:52 [patch] pow.3: Add note on performance characteristics of pow Manuel López-Ibáñez
@ 2014-10-17  5:24 ` Michael Kerrisk (man-pages)
  2014-10-17  7:58   ` Siddhesh Poyarekar
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-10-17  5:24 UTC (permalink / raw)
  To: Manuel López-Ibáñez, linux-man; +Cc: mtk.manpages, GNU C Library

Hello Manuel,


On 10/17/2014 01:51 AM, Manuel López-Ibáñez wrote:
> Hello,
> 
> This patch documents
> https://sourceware.org/bugzilla/show_bug.cgi?id=13932 as requested in
> https://sourceware.org/bugzilla/show_bug.cgi?id=15267. It would be
> nice to add more details, but it seems the behavior and its
> consequences is not well understood. The purpose of the note is to
> warn users of this behavior and thus avoid frustration
> (http://entropymine.com/imageworsener/slowpow/).
> 
> This is my first patch. I followed (hopefully correctly) the instructions here:
> https://www.kernel.org/doc/man-pages/patches.html


Thanks for this patch. It looks good. But inline patches are easier to review.
One small question below.

> diff --git a/man3/pow.3 b/man3/pow.3
> index d0a2ea8..3d2151a 100644
> --- a/man3/pow.3
> +++ b/man3/pow.3
> @@ -320,6 +320,17 @@ The variant returning
>  also conforms to
>  SVr4, 4.3BSD, C89.
>  .SH BUGS
> +On 64-bits,
> +.\"
> +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +.BR pow ()
> +may be more than 10,000 times slower for some inputs than for other nearby

I plan to change "some" to "some (rare)". Sound okay? The point is not to
worry people that this is a problem that is commonly encountered. (Or is it?)

Thanks,

Michael

> +inputs. The inputs that produce such behavior are different for
> +.BR powf (),
> +.BR pow ()
> +and
> +.BR powl ().
> +
>  In glibc 2.9 and earlier,
>  .\"
>  .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-17  5:24 ` Michael Kerrisk (man-pages)
@ 2014-10-17  7:58   ` Siddhesh Poyarekar
  2014-10-17 13:51     ` Manuel López-Ibáñez
  0 siblings, 1 reply; 6+ messages in thread
From: Siddhesh Poyarekar @ 2014-10-17  7:58 UTC (permalink / raw)
  To: Michael Kerrisk (man-pages)
  Cc: Manuel López-Ibáñez, linux-man, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 937 bytes --]

On Fri, Oct 17, 2014 at 07:24:38AM +0200, Michael Kerrisk (man-pages) wrote:
> > diff --git a/man3/pow.3 b/man3/pow.3
> > index d0a2ea8..3d2151a 100644
> > --- a/man3/pow.3
> > +++ b/man3/pow.3
> > @@ -320,6 +320,17 @@ The variant returning
> >  also conforms to
> >  SVr4, 4.3BSD, C89.
> >  .SH BUGS
> > +On 64-bits,
> > +.\"
> > +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> > +.BR pow ()
> > +may be more than 10,000 times slower for some inputs than for other nearby
> 
> I plan to change "some" to "some (rare)". Sound okay? The point is not to
> worry people that this is a problem that is commonly encountered. (Or is it?)

Rare is OK, these points don't occur very frequently.

> > +inputs. The inputs that produce such behavior are different for
> > +.BR powf (),
> > +.BR pow ()
> > +and
> > +.BR powl ().
> > +

The slow fallback is only taken for pow, not powf or powl.

Siddhesh

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-17  7:58   ` Siddhesh Poyarekar
@ 2014-10-17 13:51     ` Manuel López-Ibáñez
  2014-10-30 23:30       ` Manuel López-Ibáñez
  2014-11-11 12:58       ` Michael Kerrisk (man-pages)
  0 siblings, 2 replies; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-17 13:51 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: Michael Kerrisk (man-pages), linux-man, GNU C Library

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
>> > +inputs. The inputs that produce such behavior are different for
>> > +.BR powf (),
>> > +.BR pow ()
>> > +and
>> > +.BR powl ().
>> > +
>
> The slow fallback is only taken for pow, not powf or powl.

Updated patch inline:

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for
other nearby
+inputs.  This only affects
+.BR pow (),
+and not
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

and attached in case gmail messes it up.

Cheers,

Manuel.

[-- Attachment #2: pow.diff --]
[-- Type: text/plain, Size: 543 bytes --]

diff --git a/man3/pow.3 b/man3/pow.3
index d0a2ea8..1b05292 100644
--- a/man3/pow.3
+++ b/man3/pow.3
@@ -320,6 +320,18 @@ The variant returning
 also conforms to
 SVr4, 4.3BSD, C89.
 .SH BUGS
+On 64-bits,
+.\"
+.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
+.BR pow ()
+may be more than 10,000 times slower for some (rare) inputs than for other nearby
+inputs.  This only affects 
+.BR pow (),
+and not 
+.BR powf ()
+nor
+.BR powl ().
+
 In glibc 2.9 and earlier,
 .\"
 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-17 13:51     ` Manuel López-Ibáñez
@ 2014-10-30 23:30       ` Manuel López-Ibáñez
  2014-11-11 12:58       ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 6+ messages in thread
From: Manuel López-Ibáñez @ 2014-10-30 23:30 UTC (permalink / raw)
  Cc: Michael Kerrisk (man-pages), linux-man, GNU C Library

I think this hasn't been committed yet:

https://sourceware.org/ml/libc-alpha/2014-10/msg00389.html

Cheers,

Manuel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] pow.3: Add note on performance characteristics of pow
  2014-10-17 13:51     ` Manuel López-Ibáñez
  2014-10-30 23:30       ` Manuel López-Ibáñez
@ 2014-11-11 12:58       ` Michael Kerrisk (man-pages)
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Kerrisk (man-pages) @ 2014-11-11 12:58 UTC (permalink / raw)
  To: Manuel López-Ibáñez, Siddhesh Poyarekar
  Cc: mtk.manpages, linux-man, GNU C Library

Hello Manuel,

On 10/17/2014 03:51 PM, Manuel López-Ibáñez wrote:
> On 17 October 2014 09:58, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
>>>> +inputs. The inputs that produce such behavior are different for
>>>> +.BR powf (),
>>>> +.BR pow ()
>>>> +and
>>>> +.BR powl ().
>>>> +
>>
>> The slow fallback is only taken for pow, not powf or powl.
> 
> Updated patch inline:
> 
> diff --git a/man3/pow.3 b/man3/pow.3
> index d0a2ea8..1b05292 100644
> --- a/man3/pow.3
> +++ b/man3/pow.3
> @@ -320,6 +320,18 @@ The variant returning
>  also conforms to
>  SVr4, 4.3BSD, C89.
>  .SH BUGS
> +On 64-bits,
> +.\"
> +.\" https://sourceware.org/bugzilla/show_bug.cgi?id=13932
> +.BR pow ()
> +may be more than 10,000 times slower for some (rare) inputs than for
> other nearby
> +inputs.  This only affects
> +.BR pow (),
> +and not
> +.BR powf ()
> +nor
> +.BR powl ().
> +
>  In glibc 2.9 and earlier,
>  .\"
>  .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6776
> 
> and attached in case gmail messes it up.

Thanks for revising the patch. I've applied it.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-11-11 12:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16 23:52 [patch] pow.3: Add note on performance characteristics of pow Manuel López-Ibáñez
2014-10-17  5:24 ` Michael Kerrisk (man-pages)
2014-10-17  7:58   ` Siddhesh Poyarekar
2014-10-17 13:51     ` Manuel López-Ibáñez
2014-10-30 23:30       ` Manuel López-Ibáñez
2014-11-11 12:58       ` Michael Kerrisk (man-pages)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).