On Fri, Oct 24, 2014 at 9:30 AM, Wil Cooley <[email protected]> wrote:

>
> On Oct 23, 2014 5:04 PM, "Andy Parker" <[email protected]> wrote:
> >
> > So what all would be changing?
> ...
> >   2. YAML files that the master and agent write would move to JSON
> (node, facts, last_run_summary, state, etc.).
>
> Please store these pretty-printed rather than minimized - one long,
> unindented line of JSON is pretty intolerable to read for a human. having
> to run them through a pretty-printer manually is feasible but  cumbersome
> and not user-friendly.
>
> It might even make sense to have an flag to always pretty-print, even for
> the other cases, in case a human needs to troubleshoot.
>
Pretty printing introduces a significant overhead. On a test catalog that
we have (the one produced by our many_modules benchmark) it increases the
space needed by 52% (JSON.pretty_generate(p).size == 141065 and
JSON.generate(p).size == 92596) and increases the time to serialize by 24%.

1.9.3-p484 :017 > Benchmark.measure { 1000.times { JSON.generate(p) } }
 =>   3.650000   0.010000   3.660000 (  3.664184)

1.9.3-p484 :018 > Benchmark.measure { 1000.times { JSON.pretty_generate(p)
} }
 =>   4.390000   0.130000   4.520000 (  4.527144)

I doesn't seem like a good idea to incur those overheads at all times on
the off chance that a user will want to look at this data.

A flag might be a reasonable way of introducing this, but it seems like
using a tool like jsonpp or jq would be just as easy and doesn't require
turning on a flag and restarting the system.

> Wil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-dev/CAMmm3r4QvecPOiMTcYgRJ-Vhdedo2_NveL6Jxb-Nozeh0%2BqSmw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-dev/CAMmm3r4QvecPOiMTcYgRJ-Vhdedo2_NveL6Jxb-Nozeh0%2BqSmw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Andrew Parker
[email protected]
Freenode: zaphod42
Twitter: @aparker42
Software Developer

*Join us at **PuppetConf 2015, October 5-9 in Portland, OR - *
http://2015.puppetconf.com
*Register early to save 40%!*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CANhgQXtojipSLmPpqZTFGBZwp%2BobMfLt3P4vpXE7eXn64Pm54g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to