|
From: Ethan M. <merritt@u.washington.edu> - 2005-06-09 20:15:36
|
On Thursday 09 June 2005 09:12 am, Robert Hart wrote: > > I have attached my test program. I can't find any input on my system > that gives different results between sscanf and strtod. Very nice. Thank you. So strtod is faster on all platforms I have tried, with the largest difference on DU/alpha and the smallest difference on SunOS. Not the factor of 10X that Dimitrios Apostolou was hoping for, but up to a factor of 5X depending on the platform. linux/x86 --------- ./scan_timing 100000 "3.5D 1E07" Test atod: 0.059186 Test sscanf: 0.150265 Test strtod: 0.060353 DU/alpha --------- ./scan_timing 100000 "3.5D 1E07" Test atod: 0.100689 Test sscanf: 0.588027 Test strtod: 0.124872 linux/AMD64 ----------- ./scan_timing 100000 "3.5D 1E07" Test atod: 0.033294 Test sscanf: 0.076438 Test strtod: 0.037122 irix/MIPS R4400 ---------------- ./scan_timing 100000 "3.5D 1E07" Test atod: 0.352085 Test sscanf: 1.012914 Test strtod: 0.357065 SunOS 4.1.4 1 sun4m --------------------------- ./scan_timing 100000 "3.5D 1E07" Test atod: 2.245737 Test sscanf: 4.014354 Test strtod: 2.706037 -- Ethan A Merritt merritt@u.washington.edu Biomolecular Structure Center Mailstop 357742 University of Washington, Seattle, WA 98195 |