jacobwilliams / json-fortran

A Modern Fortran JSON API
https://jacobwilliams.github.io/json-fortran/
Other
332 stars 83 forks source link

Speed up string to real #498

Open jacobwilliams opened 2 years ago

jacobwilliams commented 2 years ago

See the discussions here and here. There is a lot of room for improvement in the string to real parsing (which is currently using read(fmt=*) which is apparently quite slow.

The C strtod routine is much faster. Could add it as an option, or maybe even the default. Is it a guarantee that every Fortran compiler will have this? Seems to be true for Gfortran and Intel.

jacobwilliams commented 2 years ago

See also: https://fortran-lang.discourse.group/t/speed-of-atoi-and-atof-vs-internal-read/3375