Thomas Pelletier 8a8d1233bb First benchmark!
~/s/g/p/g/benchmark$ go test -bench=.
goos: linux
goarch: amd64
pkg: github.com/pelletier/go-toml/v2/benchmark
cpu: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
BenchmarkUnmarshalSimple/v2-8         	 1607115	       742.0 ns/op
BenchmarkUnmarshalSimple/v1-8         	  307977	      3915 ns/op
BenchmarkUnmarshalSimple/bs-8         	  516754	      2330 ns/op
BenchmarkReferenceFile/v2-8           	    9604	    129158 ns/op	  111422 B/op	    1381 allocs/op
BenchmarkReferenceFile/v1-8           	    4521	    263808 ns/op	  130566 B/op	    2649 allocs/op
BenchmarkReferenceFile/bs-8           	    4070	    296271 ns/op	   80784 B/op	    1729 allocs/op
PASS
ok  	github.com/pelletier/go-toml/v2/benchmark	8.139s
2021-03-24 22:15:12 -04:00
2021-01-06 20:48:20 -05:00
2021-03-24 22:15:12 -04:00
2021-03-24 21:06:38 -04:00
2019-04-10 13:43:12 +01:00
2019-04-10 13:43:12 +01:00
2021-01-06 20:48:20 -05:00
2021-03-23 08:54:44 -04:00
2021-03-24 22:15:12 -04:00
LF
2021-03-13 18:51:45 -05:00
2021-02-10 10:41:23 -05:00
2021-02-10 10:41:23 -05:00
2021-03-15 08:46:35 -04:00
2021-03-23 09:02:48 -04:00
2018-07-24 11:27:17 -07:00
2021-03-24 21:02:02 -04:00
2021-03-24 22:15:12 -04:00
2021-03-24 20:21:55 -04:00
2021-03-24 21:05:44 -04:00
2021-02-02 08:28:30 -05:00
2021-03-24 20:21:55 -04:00
2021-03-24 21:05:44 -04:00

go-toml V2

Development branch. Probably does not work.

👉 Discussion on github.

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 unsafe to reuse the input byte array as storage for strings.
  • Cache reflection operations per type.

Ideas

  • Allow types to implement a ASTUnmarshaler interface to unmarshal straight from the AST?

License

The MIT License (MIT). Read LICENSE.

S
Description
Go library for the TOML file format
Readme MIT 6.5 MiB
Languages
Go 94.6%
Shell 5.4%