-
Notifications
You must be signed in to change notification settings - Fork 246
feat: Go implementation for manifestYamlDoc and escapeStringJson #742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `valueToString` operation introduced by google#742 is incompatible with the way the implementation from google#739 as it tries to manifest an object from stack while the implementation needed by the debugger returns the value as-is without further evaluation.
…gle#742) * Builtins for escapeStringJson and manifestYamlDoc * Benchmark and tests
The `valueToString` operation introduced by google#742 is incompatible with the way the implementation from google#739 as it tries to manifest an object from stack while the implementation needed by the debugger returns the value as-is without further evaluation.
} else { | ||
buf.WriteByte(' ') | ||
} | ||
aux(fieldValue, buf, cindent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the error from this call is unchecked.
Fix: #800
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR (#742) introduces a bug into manifestYamlDoc, which is now part of the 0.21.0 release. (We were even getting stack traces, but that's besides the point here.)
The fix is trivial (#800), but I'm having difficulties getting it merged -- nobody responded...
@jgraeger, can I kindly ask you, as the original author, to help me ping the right people and get the fix merged? Thanks :)
This PR introduces native Go implementations for two standard library functions in Jsonnet: manifestYamlDoc and escapeStringJson. These enhancements are a response to performance challenges, especially noticeable in cases where
quote_keys=false
is set. This issue is documented in google/jsonnet#1019 and also holds for the Go implementation.Benchmarks
On a large, non-public codebase generating megabytes of yaml from jsonnet, the runtime decreased from over 10 minutes to 8 seconds.