mirror of https://github.com/goccy/go-json.git
Reduce memory usage at compile time
This commit is contained in:
parent
4db967f28d
commit
969dfcec31
|
@ -7,7 +7,7 @@ services:
|
|||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 1200M
|
||||
memory: 600M
|
||||
working_dir: /go/src/go-json
|
||||
command: |
|
||||
sh -c "go test -c . && ls go-json.test"
|
||||
|
|
|
@ -10,6 +10,12 @@ import (
|
|||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
|
||||
// HACK: compile order
|
||||
// `vm`, `vm_escaped`, `vm_indent`, `vm_escaped_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_escaped => vm_indent => vm_escaped_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_escaped"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -10,6 +10,12 @@ import (
|
|||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
|
||||
// HACK: compile order
|
||||
// `vm`, `vm_escaped`, `vm_indent`, `vm_escaped_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_escaped => vm_indent => vm_escaped_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_indent"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
|
@ -11,6 +11,12 @@ import (
|
|||
|
||||
"github.com/goccy/go-json/internal/encoder"
|
||||
"github.com/goccy/go-json/internal/runtime"
|
||||
|
||||
// HACK: compile order
|
||||
// `vm`, `vm_escaped`, `vm_indent`, `vm_escaped_indent` packages uses a lot of memory to compile,
|
||||
// so forcibly make dependencies and avoid compiling in concurrent.
|
||||
// dependency order: vm => vm_escaped => vm_indent => vm_escaped_indent
|
||||
_ "github.com/goccy/go-json/internal/encoder/vm_escaped_indent"
|
||||
)
|
||||
|
||||
const uintptrSize = 4 << (^uintptr(0) >> 63)
|
||||
|
|
Loading…
Reference in New Issue