Jesus, 78MB is still a lot for such a simple program.
Edit: s/to JSON/to a custom structure/
I’ll check later
go.mod
module json-test
go 1.21.1
main.go
package main import (
"encoding/json"
"fmt"
)
type Foo struct {
Bar string `json:"bar"`
}
func main() {
var foo Foo
json.Unmarshal([]byte(`{"bar": "Hello, World!"}`), &foo)
fmt.Println(foo.Bar)
}
time go build && du -sh . go build 0.07s user 0.11s system 348% cpu 0.051 total
2.4M .
I'd say 15x larger and 12x slower "bigger and longer" at least.