Skip to content
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

Better JSON3.write representation #160

Open
LilithHafner opened this issue Jan 10, 2025 · 0 comments
Open

Better JSON3.write representation #160

LilithHafner opened this issue Jan 10, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@LilithHafner
Copy link
Owner

Right now, JSON3.write stores

julia> JSON3.write(stdout, @be sleep(.01));
{"samples":[{"evals":1.0,"time":0.011088246000000001,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011092579,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011094829,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011086371000000001,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011106663000000001,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011090704,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011087704,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011086996,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011083413,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0},{"evals":1.0,"time":0.011085288,"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0}]}

I'd prefer

julia> JSON3.write(stdout, @be sleep(.01));
{"evals":1.0,"time":[0.011088246000000001,0.011092579,0.011094829,0.011086371000000001,0.011106663000000001,0.011090704,0.011087704,0.011086996,0.011083413,0.011085288],"allocs":4.0,"bytes":112.0,"gc_fraction":0.0,"compile_fraction":0.0,"recompile_fraction":0.0,"warmup":1.0}

This would involve a StructTypes package extension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant