diff mbox series

[bug#54560,13/47] gnu: Add go-github-com-mailru-easyjson.

Message ID 20220325133211.5128-13-hello@lnikki.la
State New
Headers show
Series [bug#54560,01/47] gnu: Add go-google-golang-org-protobuf. | expand

Commit Message

Leo Nikkilä March 25, 2022, 1:31 p.m. UTC
* gnu/packages/golang.scm (go-github-com-mailru-easyjson): New variable.
---
 gnu/packages/golang.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

Comments

M March 25, 2022, 7:49 p.m. UTC | #1
Leo Nikkilä schreef op vr 25-03-2022 om 15:31 [+0200]:
> +    (synopsis "Fast JSON serializer for golang")
> +    (description
> +     "Package @code{easyjson} provides a fast and easy way to
> +marshal/unmarshal Go structs to/from JSON without the use of reflection.

As per (guix)Synopses and Descriptions, no marketing (‘fast and easy’)
please.

> +In performance tests, @code{easyjson} outperforms the standard
> +@code{encoding/json} package by a factor of 4-5x, and other JSON
> +encoding packages by a factor of 2-3x.")

This seems better suited for a bug report or patches to encoding/json
and the other JSON packages --- putting this in the Guix description
isn't going to improve encoding/json and friends ...
diff mbox series

Patch

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cf4c85b7cc..15a2f4310b 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -9999,6 +9999,34 @@  (define-public go-github-com-julienschmidt-httprouter
     (home-page "https://github.com/julienschmidt/httprouter")
     (license license:bsd-3)))
 
+(define-public go-github-com-mailru-easyjson
+  (package
+    (name "go-github-com-mailru-easyjson")
+    (version "0.7.7")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/mailru/easyjson")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0clifkvvy8f45rv3cdyv58dglzagyvfcqb63wl6rij30c5j2pzc1"))))
+    (build-system go-build-system)
+    (arguments
+     '(#:import-path "github.com/mailru/easyjson"))
+    (propagated-inputs (list go-github-com-josharian-intern))
+    (synopsis "Fast JSON serializer for golang")
+    (description
+     "Package @code{easyjson} provides a fast and easy way to
+marshal/unmarshal Go structs to/from JSON without the use of reflection.
+
+In performance tests, @code{easyjson} outperforms the standard
+@code{encoding/json} package by a factor of 4-5x, and other JSON
+encoding packages by a factor of 2-3x.")
+    (home-page "https://github.com/mailru/easyjson")
+    (license license:expat)))
+
 (define-public go-google-golang-org-protobuf
   (package
     (name "go-google-golang-org-protobuf")