tibbe/cassava — pull request #55 by Shimuuar (2014-05-20 15:23:16+00:00)
Title: Trim whitespaces for numeric fields

This pull request implements trimming of whitespaces for numeric fields as was suggested in #53 by me. It's implemented by changes to parse{Double,Signed,Unsigned}. Tests are included.

It leads to ~5% or so slowdown. Exact numbers fluctuate between benchmark runs

```
name new/old
1 positional/decode/presidents/without conversion 1.0887817
2 positional/decode/presidents/with conversion 1.0261922
3 positional/decode/streaming/presidents/without conversion 0.9288449
4 positional/decode/streaming/presidents/with conversion 1.0274190
5 positional/encode/presidents/with conversion 0.9919386
6 named/decode/presidents/without conversion 1.0618138
7 named/decode/presidents/with conversion 0.9508360
8 named/encode/presidents/with conversion 0.9962220
9 comparison/lazy-csv 0.9730873
```

P.S. below R script I used to generate table. Maybe it could be useful too
```
compare <- function(baseline,test) {
q1 <- read.csv(baseline,stringsAsFactors = FALSE)
q2 <- read.csv(test, stringsAsFactors = FALSE)

slowdown <- as.numeric(q2$Mean) / as.numeric( q1$Mean )
plot(slowdown, col='red')
abline(h=1)
abline(h=mean(slowdown), col='red')
#
print( data.frame(name=q1$Name, slowdown=slowdown))
}
```