Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    single vs. double (all)

    Space and time might be important in this job - it involves accumulating values from a 20MB data file each month, and then allowing the user to sort/filter/total/rank etc. the resulting 5MB-10MB data any which way they choose.

    The structure includes 24 months of Sales, 12 months of Target and 24 months of Investment, making 60 currency-like values for, oh, say 4,000+ rows of Excel, developed from at least 70,000 rows of input data (spread across several sheets).

    As I type this, I can't recall whether I read years ago that Double was more efficient than Single because everything was stored in Double anyways, and using Single meant two conversions per use, or whether the argument was for Long/Integer.

    <UL><LI>I'd appreciate input from anyone who has made the decision, especially if they measured the impact.[/list]From the programming point of view I can as easily type "Single" as "Double" in my TYPE structures.
    From the run-time point of view, it might be significant to the poor clerk who has to sit and wait for the process to run (on a 500MB/2GHz machine) on THREE different data sources.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: single vs. double (all)

    The efficiency argument was for integers, I think - 32 bit processors work better with long integers than with integers or bytes.

    I did a test, performing a set of mathematical calculations many millions of times. If I used double precision variables, the total time was about 5% longer than using single precision variables. Not a big difference - even if your process would take an hour using Single, it'd take only 3 minutes longer using Double.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: single vs. double (all)

    Thanks for the feedback, Hans.

    >The efficiency argument was for integers, I think
    Most likely. I have rarely dabbled in dbl/sng these past ten years. I'm more likely to have been cocerned about counters for loops, arrays etc.

    >the total time was about 5% longer
    Thanks for this too.
    I'm experimenting with storage space. There seems to be no difference in (Open as Binary) file size yet, hovering around 236K-237K each pass.
    I was hoping for some significance in storage space, if only to trim execution time of shuffling data around in memory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •