Releases: stephenberry/glaze
v2.6.5
Fixes
- Fixed floating point writing for
std::vector<std::byte>
. Now guarding against implicit conversions internally.
by @stephenberry in #1009 & #1011
Full Changelog: v2.6.4...v2.6.5
v2.6.4
Fixed support for Clang 16, 17, & 18 (v2.6.3 fix for GCC 14 had broken Clang)
- Glaze now has actions to build and test on Clang 16, 17, and 18 on Linux, so these issues should be avoided in the future
by @stephenberry in #1006
Improvements
- Improved write performance when objects write out all fields
- Improved write performance for some types of known sizes
Fixed
- Removed undefined behavior when using memcpy on a null pointer over zero bytes
Full Changelog: v2.6.3...v2.6.4
v2.6.3
Support for GCC 14
- GCC 11 maintenance is being dropped. Glaze will continue to ensure compatibility with GCC 12, 13, and 14.
by @stephenberry in #1001
Fixes
- Fixed a potential buffer under-read when using
const
read buffers that are extremely short (less than 12 characters).
Improvements
- More larger data set unit tests
Full Changelog: v2.6.2...v2.6.3
v2.6.2
Improvements
- CRLF (carriage return) support in CSV by @stephenberry in #980
- Faster string read/write by @stephenberry in #991
- Removed read/write file inconsistencies by @stephenberry in #992
- Moving raw_buffer and output_buffer to container_concepts by @stephenberry in #993
Fixes
- Fix asio socket->set_option by @stephenberry in #994
Thanks to everyone who contributed feedback!
Full Changelog: v2.6.1...v2.6.2
2.6.1
Important
Fixed UTF-8 reading bug that affected validation and proper parsing. (by @stephenberry in #979)
Other Fixes
- Fix for glz::skip and compile time errors when invalid by @stephenberry in #970
Improvements
- Faster string assignment (avoid null memset on resize) by @stephenberry in #968
Full Changelog: v2.6.0...v2.6.1
2.6.0
Major Update
Potentially breaking binary (BEVE) read changes
The binary error checking is becoming much more robust, with the intent to make it completely safe for untrusted inputs. Currently many, but not all, input errors are handled, so binary should only be used in trusted contexts, where the developer is handling both encoding and decoding.
Important
This update requires BEVE input buffers to be null terminated. Just like Glaze requires null termination for JSON input buffers.
- Allows fast validation
- Allows common buffer handling between binary and JSON
If you were using
std::vector<std::byte>
for your binary input buffer, simply append a null character to your buffer before reading.It is recommended to use a
std::string
for binary reading, asstd::string
ensure null termination.
Padding for Mutable Input Buffers
When non-const (mutable) input buffers are passed in (e.g. std::string
versus const std::string
), Glaze now temporarily adds padding to improve SIMD performance and reduce assembly.
This is not a breaking change. It is simply recommended to pass mutable input buffers into read calls.
The buffer is padded with null bytes while reading and then reverted at the end of the function call. Glaze does not permanently change your input buffer.
- This change reduces the produced assembly, so the overall program binary will be reduced when using mutable input buffers.
Improvements
- Faster
glz::minify_json
- Faster string reading for escaped inputs
- Faster unknown key discover in some cases
- More specific error handling for commas, colons, and quotes
minfied
Compile Time Option
If you wish to require minified JSON or know your input will always be minified, then you can gain a little more performance by using the compile time option .minified = true
.
auto ec = glz::read<glz::opts{.minified = true}>(obj, buffer);
Fixes
- Proper tab usage in
glz::prettify_json
- Using full 256 byte tables for safely handling invalid JSON
Removed Deprecations
- Removed the deprecated
macros.hpp
header - Removed the deprecated
glz::prettify
andglz::minify
functions. Use the newglz::prettify_json
andglz::minify_json
Full Changelog: v2.5.5...v2.6.0
2.5.5
Improvements
- A recent change made vector reading slower for small types in std::vector, the higher performance for small types has been restored with the improvements to large types (greater than 4096 bytes) intact
- Adding more binary checks and notes on binary safety
- Code cleanup
Full Changelog: v2.5.4...v2.5.5
2.5.4
Support unicode surrogate pairs
As per the latest JSON standard, unicode pairs can be used to encode UTF-16 characters in UTF-8 JSON. This release adds support for surrogate pairs.
const char* json = R"("\uD83D\uDE00\uD83C\uDF40😀🍀\uD83D\uDE00")"; // 😀🍀😀🍀😀
std::string val;
expect(!glz::read_json(val, json));
expect(val == "😀🍀😀🍀😀");
Float max write precision
Adds the ability to set the maximum write precision for floating point values. Wrappers are also provided to locally turn this feature on and off. This reduces the size of the JSON output for floating point numbers when the precision isn't needed on output and is especially useful for std::float128_t
. See documentation at max-float-precision.md
Examples:
double pi = std::numbers::pi_v<double>;
std::string json_double = glz::write_json(pi);
constexpr glz::opts options{.float_max_write_precision = glz::float_precision::float32};
std::string json_float = glz::write<options>(pi);
expect(json_float == glz::write_json(std::numbers::pi_v<float>));
std::vector<double> double_array{pi, 2 * pi};
json_double = glz::write_json(double_array);
json_float = glz::write<options>(double_array);
expect(json_float == glz::write_json(std::array{std::numbers::pi_v<float>, 2 * std::numbers::pi_v<float>}));
Improvements
- Using 256 byte tables for invalid JSON safety by @stephenberry in #937
- Faster escaped unicode handling
Full Changelog: v2.5.3...v2.5.4
2.5.3
Improvements
- Faster string comparison in #925
- Cleaned/optimized error message generation and includes in #927
- Uses less allocations/memory as well, which is good for embedded platforms
- Support tag property in tagged variants by in #929
- Better errors when attempting to write to a const buffer in #933
Internal Cleanup
- Removed unused tuplet _tag in #924
Full Changelog: v2.5.2...v2.5.3
2.5.2
Fixes
glz::get_as_json
fixed for intermediate array access by @stephenberry in #923- Much improved error handling for the function
Improvements
- Faster skipping
- Faster whitespace parsing in common contexts
Full Changelog: v2.5.1...v2.5.2