-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Replace to gopkg.in/yaml with github.com/goccy/go-yaml (slightly breaking change) #8822
Comments
See go-yaml/yaml#770 |
Everyone once in a while a user gets burned by "on/off/yes/no" keys. This happened again yesterday. While I understand why this is blocked, I must say I have little sympathy for unqualified dates. If we could start over, or break some eggs, I'd place every unqualified date in Etc/UTC. |
Consider replacing github.com/go-yaml/yaml (last updated 2.5 years ago) with github.com/goccy/go-yaml which, at the moment, is actively maintained with 1.2k stars. What we get:
|
Just to be clear, this is a very common "unqualified date" (for one, it's very easy to type, which I have sympathy for ...):
Having the above mean UTC, would create very surprising beheaviour. |
Out of the box it's significantly slower than what we had: ``` pkg: github.com/gohugoio/hugo/parser/metadecoders cpu: Apple M1 Pro │ master.bench │ fix-goyaml-8822.bench │ │ sec/op │ sec/op vs base │ DecodeYAMLToMap-10 6.758µ ± 20% 10.505µ ± 25% +55.43% (p=0.000 n=8) │ master.bench │ fix-goyaml-8822.bench │ │ B/op │ B/op vs base │ DecodeYAMLToMap-10 8.461Ki ± 0% 11.021Ki ± 0% +30.26% (p=0.000 n=8) │ master.bench │ fix-goyaml-8822.bench │ │ allocs/op │ allocs/op vs base │ DecodeYAMLToMap-10 108.0 ± 0% 281.0 ± 0% +160.19% (p=0.000 n=8) ``` Fixes gohugoio#8822
Add this to have something to track this with.
The main blocker I see for this is that it's not possible to control location/timezone for dates without that information.
Prints:
Note that
v2
isn't perfect, either, but that at least allows us to handle known dates (e.g. the front matter dates).The text was updated successfully, but these errors were encountered: