You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a custom "Output_sink" module for emitting strings
OCaml doesn't have a good abstraction over writing text to generic
output (file, stdout, to memory). As a result, we often end up using
Format.formatter as an arbitrary output source.
This is fine in some use-cases. However, Format is designed around
pretty-printing values, rather than being high-performance. We see this
particularly when emitting HTML, with the format machinery contributing
a significant amount of time.
This change adds a new Output_sink module, which effectively exposes a
single "write" method. We switch the HTML module over to this.
This provides a significant performance boost. For a CC:T doc-gen this
reduces allocations and time taken by ~15%.
0 commit comments