csFastFloat icon indicating copy to clipboard operation
csFastFloat copied to clipboard

Create version that does not automatically skip leading spaces

Open lemire opened this issue 4 years ago • 0 comments

In C#...

System.Buffers.Text.Utf8Parser.TryParse(x, out double d, out int consumed)

will not skip leading spaces whereas

Double.Parse(" 11  ")

will...

Meanwhile, the csFastFloat functions always skip leading spaces.

To get fair comparisons, we should create versions (maybe just for ASCII strings) of our functions which do not skip leading spaces.

Note that the cost of skipping leading spaces may not be a small as one would hope. It might cost several cycles and it adds several (predictable?) branches.

lemire avatar Mar 01 '21 15:03 lemire