Commits

Daniel Dunbar committed fdd4bbca920
[Utility] Add infrastructure for efficient streaming output. This adds Utility infrastructure for several closely related things: - A new ByteString type, which is just a wrapper for a UInt8 array. This is useful to have as a separate type because operations on arrays of bytes are very common and can benefit from extra support. - An OutputByteStream class, which is designed to expose an efficient API for the writing of streaming data. For now, it just supports writing to an internal buffer, but the goal is that eventually it could support streaming directly to disk to avoid unnecessary in memory data. This is closely modeled on `llvm::raw_ostream`. - A streaming operator `<<<` for use with the above stream. - An infrastructure for streaming out "formatted" data (e.g., JSON) without unnecessary copying. For example, this API allows writing a JSON-formatted list with needing to construct temporary strings. This commit adds performance tests, which you can run and use to investigate performance on a release build, but they are disabled completely for now because we don't have a way to disable them for debug builds, where they are too slow to run as part of incremental development.