fs2-data
fs2-data copied to clipboard
Improve stream rendering performances
This change addresses #634 in two ways:
- A change to the generic pretty printer that allows to avoid:
- Boxing of integers when computing the layout
- Instantiating many tuples that are immediately discarded
- Creating intermediate chunks by fusing the annotation and rendering phases
- Re-introduce a direct compact rendering for JSON, that is way simpler than leveraging the generic printer with no groups
By doing so, the compact rendering should be back to the performance in 1.10 and the pretty case is improved a bit.
Here are some benchmark results with the compact rendering in 1.11.1 as the baseline. 1.11.2 represents the results with this change.
xychart-beta
title "Rendering of int array"
x-axis ["Pretty 1.10", "Pretty 1.11.1", "Pretty 1.11.2", "Compact 1.11.1", "Compact 1.11.2"]
y-axis "Factor" 0 --> 1.2
bar [0.02, 1.12, 0.71, 1, 0.004]
xychart-beta
title "Rendering of int object"
x-axis ["Pretty 1.10", "Pretty 1.11.1", "Pretty 1.11.2", "Compact 1.11.1", "Compact 1.11.2"]
y-axis "Factor" 0 --> 1.2
bar [0.01, 1.11, 0.85, 1, 0.01]
@recons This PR should solve your problem with compact rendering once merged and released.