Menno Finlay-Smits
acaf5f097a
pkg/escape: Add benchmarks for all bytes escape/unescape funcs
2018-01-16 11:12:47 +13:00
Menno Finlay-Smits
b0e871876a
pkg/escape: Preallocate output in Unescape
...
Preallocating the capacity of the output is faster and uses less
memory than letting append() do its own (over)allocation.
2018-01-16 09:37:37 +13:00
Mark Rushakoff
0551d87ddb
Update godoc for pkg
2016-12-30 18:03:01 -08:00
Cameron Sparr
fa2b78d67e
Optimize string escaping & unescaping
...
benchmarks pre-commit:
go test ./pkg/escape/... -bench=. -benchmem
BenchmarkStringEscapeNoEscapes-8 10000000 122 ns/op 0 B/op 0 allocs/op
BenchmarkStringUnescapeNoEscapes-8 300000000 5.69 ns/op 0 B/op 0 allocs/op
BenchmarkManyStringEscape-8 1000000 1073 ns/op 320 B/op 8 allocs/op
BenchmarkManyStringUnescape-8 1000000 1557 ns/op 288 B/op 8 allocs/op
PASS
ok github.com/influxdata/influxdb/pkg/escape 6.304s
benchmarks post-commit:
go test ./pkg/escape/... -bench=. -benchmem
BenchmarkStringEscapeNoEscapes-8 100000000 17.5 ns/op 0 B/op 0 allocs/op
BenchmarkStringUnescapeNoEscapes-8 300000000 5.70 ns/op 0 B/op 0 allocs/op
BenchmarkManyStringEscape-8 3000000 451 ns/op 224 B/op 6 allocs/op
BenchmarkManyStringUnescape-8 2000000 944 ns/op 304 B/op 9 allocs/op
PASS
ok github.com/influxdata/influxdb/pkg/escape 8.727s
2016-11-24 10:25:35 +00:00
Cameron Sparr
3fe0ffd5ad
String escape unit tests
2016-11-18 16:02:52 +00:00
Joe LeGasse
743946fafb
models: Add FieldIterator type
...
The FieldIterator is used to scan over the fields of a point, providing
information, and delaying parsing/decoding the value until it is needed.
This change uses this new type to avoid the allocation of a map for the
fields which is then thrown away as soon as the points get converted
into columns within the datastore.
2016-10-03 16:30:21 -06:00
Jason Wilder
84c776bf2a
Skip allocating string in unescapeString
2016-05-27 10:30:08 -06:00
Jason Wilder
4b32760dac
Use stdlib func instead of scanning slices
2016-04-20 16:08:58 -06:00
Jason Wilder
fde5576d64
Avoid allocations when no escape chars present
2016-04-20 16:00:26 -06:00
Ben Johnson
d9a6a7340f
add canonical paths
2016-02-10 11:30:52 -07:00
David Howden
7491564f9d
Added tests for esape.Unescape
2015-10-16 10:14:47 +11:00
Cory LaNou
7284e314e5
add pkg files
2015-09-16 16:41:56 -05:00