in reply to Re: Speeds vs functionality
in thread Speeds vs functionality
The first check on every byte in a CSV stream is the check on the separation character. Every extra test on that byte will cause that extra test to be executed for every single byte in the stream.
Is it really so difficult to lift the single/multi-byte test out of the loop?
Even if it means that everything inside the loop is duplicated, that needn't imply a maintenance problem.
You could, for example, make the body of the (now two) loops an inlined function. They've been a part of the standard for 15 years and gcc had them long before that.
If you really feel the need to support compilers that don't, you could always substitute (another)of those aweful multiline macros.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Speeds vs functionality
by Tux (Canon) on Jul 29, 2014 at 13:14 UTC | |
by BrowserUk (Patriarch) on Jul 29, 2014 at 13:30 UTC |