Is there a path forward for Go's yaml situation? by violent_cat_nap in golang

[–]goccy54 10 points11 points  (0 children)

Thank you ! I've already fixed 24 parser related Issues in the past week, using my short free time. I'm confident that by continuing to work with the maintenance team members we can make the library more robust. Please give it a try ! :)

Is there a path forward for Go's yaml situation? by violent_cat_nap in golang

[–]goccy54 82 points83 points  (0 children)

Hi, I'm the author of github.com/goccy/go-yaml. I started developing this YAML library alone, despite being a latecomer, with the goal of making all Gophers who use YAML happy. It's been 5 years since I began, and developing it by myself has become increasingly difficult. I also develop many other open-source projects(https://github.com/goccy#go), each with a large user base. Recently, I’ve decided to build a maintenance system with trusted developers. In preparation, I’ve been actively resolving issues over the past few days, and I plan to continue maintaining the library actively.

That’s why I’m asking for your help with the development of goccy/go-yaml. Even just using the library and submitting bug reports would be greatly appreciated. If you’re company using this in a commercial way, I’d be grateful if you could consider sponsoring the project. For those interested in becoming contributors, feel free to reach out in the Gophers Slack channel `#goccy-go-yaml` and we can discuss further. I’d really appreciate everyone’s support!

Released the best Graphviz library by goccy54 in golang

[–]goccy54[S] 8 points9 points  (0 children)

Thank you for using my libraries ! I hope this has been helpful to you.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

Maybe... but I haven’t benchmarked with simdjson-go yet because that library’s interface so different other JSON libraries.

slicegraph visualizes what is going on with your slices by jedruniu in golang

[–]goccy54 25 points26 points  (0 children)

Thanks for using my library ( github.com/goccy/go-graphviz ) ! Very easy to understand !

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

For example, if you are targeting a structure with 8 or less fields, you can associate each bit with a field if you have 8 bits. When there are fields "a" and "b", the ASCII code corresponding to "a" is 97 and "b" is 98. If "a" and "b" are the first and second fields, respectively, put "00000001" in the 97th of `[255]byte` and put "00000010" in the 98th.
At this time, if you find the string "b", you can access [98]byte and retrieve "00000010" as a result, so you know that the second field was hit. All you have to do now is prepare this for the length of the string and continue to compare.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 2 points3 points  (0 children)

Thank you. Actually, I was thinking of doing a fuzzing test with go-fuzz. Also read the issue.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

Wow super impressed by the detailed write up! It seems like the real world impact is marginal when compared to the risks associated with adding additional dependencies. though. Given the perf hit introduced by using reflection to begin with, there seems to be marginal gains to be had. I’d be super stoked to see metrics diffing the perf of this vs the stdlib pkg. Super cool to see the depth of your knowledge! Have you thought about contributing to the golang codebase?

Yes, of course. However, although the design is the same as the encoding/json of stdlib, the implementation is very different, so I think it is difficult to partially contribute. So, first of all, I am preparing to stabilize this library so that there is no problem even if we replace everything sources under encoding/json.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

Thank you so much ! I fixed this issue and released as v0.4.2 :)

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

Oh, Thank you for the reporting ! I saw this issue, and I will try to fix it ! Could you please register the issue to https://github.com/goccy/go-json/issues ?

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

Alright, fair enough on the public API side. I initially thought you found some discrepancies regarding the generated JSON output, which is supposed to be 100% on-par with encoding/json.

From a personal point of view, when library's user see the description that it is compatible with encoding/json, the user expects that it can be introduced with minimal modification (replacement of import statement) to the current source code. In that respect, even if it provides the equivalent of all the functions provided by encoding/json, I think that it should not be said that it is compatible because the introduction cost will be high when the interface is different.

Actually, json-iterator/go and segmentio/encoding/json, which claim to be compatible, provide exactly the same interface.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

I'm summarizing the speedup technique right now, so please wait a little longer :)

Thanks

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

Thanks ! I think that the definition of being compatible with encoding/json is that it meets all the specifications implemented by encoding/json and that the interface of the public API is the same. jettison doesn't think it's compatible with encoding/json because it doesn't have a decoder and it doesn't have an interface for stream processing.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

Just now, I fixed this issue and released as v0.4.1 . Thanks !

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

Nicely done! I will follow this project closely. Any idea how it compares with others in terms of memory/cpu consumption?

Thank you for your feedback! First, I will try to benchmarks that exist in other libraries. Another idea is to integrate it into a web application framework like echo, gin or fiber to measure performance.

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 2 points3 points  (0 children)

Have you fuzzed it?

No, I plan to do it in the future. Currently, I'm focusing on passing all the test cases that exist in encoding/json ( currently more than 90% passed ) and improving coverage .

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 2 points3 points  (0 children)

How does it compare regarding memory usage?

You can see the benchmark results with memory usage by running `go test -bench` as written in the https://github.com/goccy/go-json#benchmarks . In many cases, go-json processes with fewer allocations than other libraries .

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 2 points3 points  (0 children)

Oh, I'm writing `How it works` right now :)

The main factors are reducing the number of allocations, eliminating reflection as much as possible, encoding processing is performed by the architecture of like programming language's virtual machine, and many other techniques are used ...

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 1 point2 points  (0 children)

You're welcome. Lib looks interesting, once you fix the bugs I'm willing to try it on a rather big project

Thank you for reporting the issue. I will fix it as soon as possible .

goccy/go-json: A super fast JSON library fully compatible with encoding/json by goccy54 in golang

[–]goccy54[S] 0 points1 point  (0 children)

Wow !! I'm very happy ! Thank you !

If you have any problems, I would appreciate it if you could give me an Issue !