Files
releases/internal
robmyersrobmyers 56c9aa5bbe gqlparser: Add JSON annotation in internal/gqlparser/ast to Position fields (#7509)
Annotate internal/gqlparser structs not to include Position when marshaled
to JSON.  This makes the JSON roundtrip succeed without allocating a ton of
memory for JSON fields that will be subsequently pruned.

Upstream PR: https://github.com/vektah/gqlparser/pull/364

$ time ./reproducer-pre-fix
Now passing 1262568 bytes to builtinGraphQLParseSchema() to reproduce the issue in ast.InterfaceToValue()
Alloc = 4159 MiB	TotalAlloc = 5625 MiB	Sys = 5584 MiB	NumGC = 18
Alloc = 8312 MiB	TotalAlloc = 11169 MiB	Sys = 11125 MiB	NumGC = 19
Alloc = 8312 MiB	TotalAlloc = 11169 MiB	Sys = 11125 MiB	NumGC = 19
Alloc = 16615 MiB	TotalAlloc = 22247 MiB	Sys = 22209 MiB	NumGC = 20
Alloc = 16615 MiB	TotalAlloc = 22247 MiB	Sys = 22209 MiB	NumGC = 20
Alloc = 16615 MiB	TotalAlloc = 22247 MiB	Sys = 22209 MiB	NumGC = 20
Alloc = 38765 MiB	TotalAlloc = 44397 MiB	Sys = 44377 MiB	NumGC = 20
Alloc = 33223 MiB	TotalAlloc = 44397 MiB	Sys = 44377 MiB	NumGC = 21

$ time ./reproducer-post-fix
Now passing 1262568 bytes to builtinGraphQLParseSchema() to reproduce the issue in ast.InterfaceToValue()

real	0m0.545s
user	0m0.201s
sys	0m0.028s

Signed-off-by: Rob Myers <1243316+robmyersrobmyers@users.noreply.github.com>
2025-04-16 17:57:31 +02:00
..
2024-12-12 15:09:03 +01:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:27:34 +01:00
2024-12-12 15:09:03 +01:00
2024-12-12 15:27:34 +01:00