mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-24 23:03:02 +00:00
3d9c4f513b
The list handling is surprisingly expensive: ``` ▶ go test -run="NONE" -bench="BenchmarkFrontmatterTags" -test.benchmem=true ./parser | prettybench PASS benchmark iter time/iter bytes alloc allocs --------- ---- --------- ----------- ------ BenchmarkFrontmatterTags/JSON:1-4 1000000 2039.00 ns/op 912 B/op 20 allocs/op BenchmarkFrontmatterTags/JSON:11-4 300000 5202.00 ns/op 1640 B/op 44 allocs/op BenchmarkFrontmatterTags/JSON:21-4 200000 7993.00 ns/op 2392 B/op 65 allocs/op BenchmarkFrontmatterTags/YAML:1-4 200000 9359.00 ns/op 5928 B/op 66 allocs/op BenchmarkFrontmatterTags/YAML:11-4 100000 21218.00 ns/op 8408 B/op 140 allocs/op BenchmarkFrontmatterTags/YAML:21-4 50000 32852.00 ns/op 10920 B/op 211 allocs/op BenchmarkFrontmatterTags/TOML:1-4 100000 21505.00 ns/op 9231 B/op 173 allocs/op BenchmarkFrontmatterTags/TOML:11-4 20000 82919.00 ns/op 19808 B/op 625 allocs/op BenchmarkFrontmatterTags/TOML:21-4 10000 141847.00 ns/op 31200 B/op 1106 allocs/op ok github.com/spf13/hugo/parser 17.890s ``` See #3464 |
||
---|---|---|
.. | ||
frontmatter.go | ||
frontmatter_test.go | ||
long_text_test.md | ||
page.go | ||
page_test.go | ||
parse_frontmatter_test.go |