Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial benchmark against other libraries #175

Merged
merged 3 commits into from
Jun 25, 2017

Conversation

pelletier
Copy link
Owner

@pelletier pelletier commented Jun 2, 2017

Compare go-toml to json and yaml. First results:

BenchmarkUnmarshalToml-8             1000  1320117 ns/op  450932 B/op  15072 allocs/op
BenchmarkUnmarshalBurntSushiToml-8   3000   402897 ns/op   82900 B/op   1761 allocs/op
BenchmarkUnmarshalJson-8            20000    66092 ns/op    3536 B/op    101 allocs/op
BenchmarkUnmarshalYaml-8            10000   189600 ns/op   44872 B/op   1058 allocs/op

Plenty of room for improvement.

Related to #167

@bep @kevinburke @moorereason

Compare go-toml to json and yaml. First results:

BenchmarkUnmarshalToml-8   1000  1263198 ns/op  450912 B/op  15072 allocs/op
BenchmarkUnmarshalJson-8  20000    61568 ns/op    3536 B/op    101 allocs/op
BenchmarkUnmarshalYaml-8  10000   178127 ns/op   44872 B/op   1058 allocs/op
@bep
Copy link

bep commented Jun 2, 2017

I would also add BurntSushi's TOML to the mix, it seem to be pretty fast.

@kevinburke
Copy link
Contributor

Thats' also not really a fair comparison, the toml library preserves much more data about the underlying file (so it can be accurately reproduced)

@pelletier
Copy link
Owner Author

@bep Good idea.
@kevinburke Although that's the case in the current implementation, I don't think Unmarshal should do that, given that this information would be lost anyway.

BenchmarkUnmarshalToml-8             1000  1320117 ns/op  450932 B/op  15072 allocs/op
BenchmarkUnmarshalBurntSushiToml-8   3000   402897 ns/op   82900 B/op   1761 allocs/op
BenchmarkUnmarshalJson-8            20000    66092 ns/op    3536 B/op    101 allocs/op
BenchmarkUnmarshalYaml-8            10000   189600 ns/op   44872 B/op   1058 allocs/op
@pelletier pelletier merged commit 4a000a2 into master Jun 25, 2017
@pelletier pelletier deleted the pelletier/benchmark-unmarshall branch August 25, 2017 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants