public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39087]  New: Performance using COMPLEX data type
@ 2009-02-03 15:44 m4341 at abc dot se
  2009-02-03 15:47 ` [Bug fortran/39087] " m4341 at abc dot se
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: m4341 at abc dot se @ 2009-02-03 15:44 UTC (permalink / raw)
  To: gcc-bugs

I have noticed that in some cases - especially calculating Mandelbrot Fractals
there is a severe performance penalty if the COMPLEX data type is used instead
of plain variables.

It's nothing wrong with the calculation, but it shall be noted that it can mean
a severe performance penalty if the COMPLEX data type is used.

Result of test cases I have created:
---
[root@cvs2 frac]# time ./m6

real    0m5.806s
user    0m1.705s
sys     0m0.032s
[root@cvs2 frac]# time ./m7

real    0m18.598s
user    0m12.469s
sys     0m0.036s

---


-- 
           Summary: Performance using COMPLEX data type
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: m4341 at abc dot se


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39087


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

* [Bug fortran/39087] Performance using COMPLEX data type
  2009-02-03 15:44 [Bug fortran/39087] New: Performance using COMPLEX data type m4341 at abc dot se
@ 2009-02-03 15:47 ` m4341 at abc dot se
  2009-02-03 15:50 ` m4341 at abc dot se
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: m4341 at abc dot se @ 2009-02-03 15:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from m4341 at abc dot se  2009-02-03 15:46 -------
Created an attachment (id=17234)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17234&action=view)
Test cases for demonstrating performance impact.

The attached file contains code that is in it's current state requiring
Xwindows, but it's completely optional for the test case and is only used to
display the result.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39087


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

* [Bug fortran/39087] Performance using COMPLEX data type
  2009-02-03 15:44 [Bug fortran/39087] New: Performance using COMPLEX data type m4341 at abc dot se
  2009-02-03 15:47 ` [Bug fortran/39087] " m4341 at abc dot se
@ 2009-02-03 15:50 ` m4341 at abc dot se
  2009-02-03 16:15 ` rguenth at gcc dot gnu dot org
  2009-02-03 16:52 ` bonzini at gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: m4341 at abc dot se @ 2009-02-03 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from m4341 at abc dot se  2009-02-03 15:50 -------
Notice that the test cases have been executed on a Pentium III computer with
dual 866MHz processors.

The 'depth' variable in the example code has been set to produce comfortable
execution times for the forementioned computer.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39087


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

* [Bug fortran/39087] Performance using COMPLEX data type
  2009-02-03 15:44 [Bug fortran/39087] New: Performance using COMPLEX data type m4341 at abc dot se
  2009-02-03 15:47 ` [Bug fortran/39087] " m4341 at abc dot se
  2009-02-03 15:50 ` m4341 at abc dot se
@ 2009-02-03 16:15 ` rguenth at gcc dot gnu dot org
  2009-02-03 16:52 ` bonzini at gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-03 16:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2009-02-03 16:15 -------
Use -ffast-math.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39087


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

* [Bug fortran/39087] Performance using COMPLEX data type
  2009-02-03 15:44 [Bug fortran/39087] New: Performance using COMPLEX data type m4341 at abc dot se
                   ` (2 preceding siblings ...)
  2009-02-03 16:15 ` rguenth at gcc dot gnu dot org
@ 2009-02-03 16:52 ` bonzini at gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: bonzini at gnu dot org @ 2009-02-03 16:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from bonzini at gnu dot org  2009-02-03 16:52 -------
more precisely, without -ffast-math gcc is not able to change abs(z) < 2 to
r*r+i*i < 4 and computes a square root on every iteration.


-- 

bonzini at gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39087


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

end of thread, other threads:[~2009-02-03 16:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-03 15:44 [Bug fortran/39087] New: Performance using COMPLEX data type m4341 at abc dot se
2009-02-03 15:47 ` [Bug fortran/39087] " m4341 at abc dot se
2009-02-03 15:50 ` m4341 at abc dot se
2009-02-03 16:15 ` rguenth at gcc dot gnu dot org
2009-02-03 16:52 ` bonzini at gnu dot org

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).