-
Notifications
You must be signed in to change notification settings - Fork 445
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
Natively convert values to multi-line json documents #187
Comments
How much does the 5x performance penalty affect you in real terms (i.e. the total run time goes from x seconds to y seconds)? |
4 seconds vs 20 seconds.
|
Ok that's significant enough to do something. I wonder if there is a more general fix that would improve the execution performance without adding more native functionality. E.g. I think std.join() can be made faster. How would you characterize the JSON in this case? Is it long arrays, long strings, big objects, or just very deep? Even better is if you can give a realistic sample that takes that long. |
Actually, the performance numbers cited above was using a version of In my jsonnet document, I call manifestJson ten times on objects of various On Thu, May 19, 2016 at 7:13 AM, Dave Cunningham notifications@github.com
|
Oh actually the performance improvement was due to compilation mode: When On Thu, May 19, 2016 at 2:01 PM, Shimin Guo shimin@databricks.com wrote:
|
Ah thanks for figuring it out. The only performance improvement between those two releases was related to std.format() and the % string formatting operator which didn't sound like it would match your case. Are you ok with 7 seconds for now? I am currently investing all my energy in updating documentation which has fallen far behind. |
Yeah it's fine for now.
|
Feel free to re-open if you're spending an unreasonable amount of time waiting for Jsonnet :) |
When a value is coerced to a string, it is converted to a single-line JSON document in C++. If you want a multi-line JSON document, you can use the recently-added stdlib function manifestJson. However, in my case, manifestJson has a 5x performance penalty compared to the native conversion. It would be nice to provide a way to convert values to multi-line JSON documents natively.
The text was updated successfully, but these errors were encountered: