|
From: Robert H. <en...@no...> - 2005-06-08 23:24:23
|
On Wed, 8 Jun 2005, Ethan Merritt wrote: > Are you saying that the speed gain could be achieved just by > replacing sscanf with atof in the standard code path, even though it still > takes the time to check for d/D/q/Q and rescan if found? Not quite. atof is definitely faster than sscanf, however, atof doesn't tell you how many characters it actually read, so that is why (I presume) that sscanf is used instead. However, in both cases, we manually scan for the next seperator one character at a time, so it wouldn't be hard to 'notice' is we pass a dDqQ on the way. Another option I haven't tried/benchmarked is to use strtof. If this is as fast as atof, then we should use it, because it'll give us a pointer to where it finished. Anyway, bed time here, but I think any code that can be culled from this function has got to be a win. Good luck Rob This message has been checked for viruses but the contents of an attachment may still contain software viruses, which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. |