9d3a912da0c0c2b69bc2720c4c0d8c3d217d1cf1
Comparing: old: v2-wip/17299c9 (2021-03-25 20:19:40 -0400 -0400) run: v2-wip/1da2fc7 (2021-03-25 20:38:05 -0400 -0400) ----------------------------------------------------------- name old time/op new time/op delta UnmarshalSimple/v2-8 755ns ± 3% 700ns ± 3% -7.26% (p=0.008 n=5+5) UnmarshalSimple/v1-8 3.87µs ± 0% 3.85µs ± 1% ~ (p=0.254 n=4+5) UnmarshalSimple/bs-8 2.44µs ± 4% 2.34µs ± 2% ~ (p=0.056 n=5+5) ReferenceFile/v2-8 33.5µs ± 7% 32.2µs ±13% ~ (p=0.421 n=5+5) ReferenceFile/v1-8 269µs ± 3% 270µs ± 2% ~ (p=1.000 n=5+5) ReferenceFile/bs-8 296µs ± 2% 291µs ± 0% ~ (p=0.095 n=5+5) name old alloc/op new alloc/op delta ReferenceFile/v2-8 38.9kB ± 0% 37.1kB ± 0% -4.77% (p=0.008 n=5+5) ReferenceFile/v1-8 131kB ± 0% 131kB ± 0% ~ (all equal) ReferenceFile/bs-8 80.8kB ± 0% 80.8kB ± 0% ~ (p=0.841 n=5+5) name old allocs/op new allocs/op delta ReferenceFile/v2-8 181 ± 0% 152 ± 0% -16.02% (p=0.008 n=5+5) ReferenceFile/v1-8 2.65k ± 0% 2.65k ± 0% ~ (all equal) ReferenceFile/bs-8 1.73k ± 0% 1.73k ± 0% ~ (all equal)
go-toml V2
Development branch. Probably does not work.
Must do
- Unmarshal into maps.
- Support Array Tables.
- Unmarshal into pointers.
- Support Date / times.
- Support struct tags annotations.
- Support Arrays.
- Support Unmarshaler interface.
- Original go-toml unmarshal tests pass.
- Benchmark!
- Abstract AST.
- Attach comments to AST (gated by parser flag).
- Track file position (line, column) for errors.
- Benchmark again!
Further work
- Rewrite AST to use a single array as storage instead of one allocation per node.
- Provide "minimal allocations" option that uses
unsafeto reuse the input byte array as storage for strings. - Cache reflection operations per type.
Ideas
- Allow types to implement a
ASTUnmarshalerinterface to unmarshal straight from the AST?
License
The MIT License (MIT). Read LICENSE.
Description
Languages
Go
94.6%
Shell
5.4%