Don,

I suggest you not attempt any sort of conversion before doing some timing
experiments.  With a few cleverly placed getCurrentTimeMillis(), it should
be straightforward to determine if a converted section of code executes
faster.  Be sure to run the experiment several times using floats and
doubles for some selected section of code, as results may vary.

Memory usage will go up of course, but that may not matter - depends on your
application.

My prediction: you will see little, if any, improvement.  Years ago I had
the pleasure (!) of converting a FORTRAN code from REAL*4 to REAL*8 (4 bytes
and 8 bytes, respec), and saw little (approx 10%) performance drop.

Chris

> -----Original Message-----
> From: Casteel, Don [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, November 01, 1999 12:46 PM
> To:   [EMAIL PROTECTED]
> Subject:      [JAVA3D] float -vs- double
>
> Is it reasonable to assume I will see a significant improvement in speed
> if
> I take the time to convert everything that's double precision to float
> precision?
>
> Changing everything over will take quite a bit of time, so I thought I'd
> ask
> before spending the time. This means all of my Point3d's would have to be
> changed to Point3f's and all double's to float's plus adding Explicit
> casts
> for things like:
>
>                 float intNum = (i/135.0+0.28)*scale;
>                 float radianConv = Math.PI*2;
>
> both have to change to:
>
>                 float intNum = (i/135.0f+0.28f)*scale;  //(assuming i &
> scale are floats)
>                 float radianConv = (float)(Math.PI*2);
>
> Has anyone done a comparison on this in the past?
>
> Don Casteel
>
> Manufacturing Engineer
> TEXTRON Automotive Company -- Athens Operations
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         Voice:  (423)744-1109
>         Fax:    (423)744-1112
>         Pager:  (423)744-1129  -- 109
>                 Internet:       [EMAIL PROTECTED]
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff JAVA3D-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to