4 ms·
I'm really not surprised. fscanf is a really general thing, it handles many cases and has to do 'perfect' text to floating point conversions. As a rule of thum
by tux3 12y ago
I'm really not surprised. fscanf is a really general thing, it handles many cases and has to do 'perfect' text to floating point conversions.
As a rule of thumb the formatted I/O functions are quite slow, and floating point makes this much much worse.
It's one of those few places where rolling your own functions for your particular use case will be much more efficient than using the one size fits all standard library solutions.