This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Daniel Kraft wrote:Wow, that's impressive!However, I then looked further, and discovered that read_f, the caller of convert_real, is already doing most of the work! And then, it prints the number back to a string just to parse it again using convert_real... With the simple (experimental and rough) patch attached, the final floating point value can be calculated with little additional effort in read_f, without ever calling convert_real. This cuts the execution time in half to 15.5s!
The only weak point is that I'm not sure if we may experience rounding errors in parsing the float due to all the *10 and + operations, and that could be something strtod takes care of. On the other hand, I think this is rather unlikely. What do you think about this one?integers can be represented exactly, so there won't be any problem. But you could overflow, or at least have problem with very long numbers/digit-strings. Problems could raise with non-format-matching numbers too. The evil is in the details as usual. Note that I know nothing about libgfortran, io.c, and had a very superficial look at read_f, so that I'm not the one to give you tips there.
Cheers, Daniel
-- Done: Arc-Bar-Cav-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri-Ran
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |