From 2bab3cc0cc5fe77b5be9e745e380a8759fe539db Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 2 Jun 2026 14:07:40 -0700 Subject: [PATCH] Update changelog --- ChangeLog.md | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index f7deab4b..17560b81 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,8 +1,16 @@ # 12.2.0 - TBD -- Added a C11 API with type-safe formatting via `_Generic`. The new `fmt-c` - library and `fmt/fmt-c.h` header allow C code to use {fmt}'s formatter - with compile-time type checking +- Added a C11 API that brings fast, type-safe formatting to C. The new + `fmt-c` library and `fmt/fmt-c.h` header use `_Generic` to dispatch on + argument types and outperform `printf`/`sprintf`. For example: + + ```c + #include + + char buf[100]; + int n = fmt_format(buf, sizeof(buf), "The answer is {}.", 42); + ``` + (https://github.com/fmtlib/fmt/issues/4663, https://github.com/fmtlib/fmt/pull/4671, https://github.com/fmtlib/fmt/pull/4696, @@ -11,11 +19,8 @@ https://github.com/fmtlib/fmt/pull/4712). Thanks @Soumik15630m, @yrlf and @localspook. -- Reduced binary size of debug builds (~200k to ~85k in the bloat test) and - improved compile speed when consteval is unavailable. - - Added a separate `fmt::fmt-module` CMake target for C++20 modules and a - Linux CI workflow that exercises module-based builds + CI workflow that exercises module-based builds (https://github.com/fmtlib/fmt/issues/4684, https://github.com/fmtlib/fmt/pull/4685, https://github.com/fmtlib/fmt/issues/4707, @@ -27,23 +32,38 @@ - Enabled the full Dragonbox lookup cache by default for floating-point formatting unless optimizing for binary size (`__OPTIMIZE_SIZE__`), giving a ~10–25% speedup. Thanks Matthias Kretz for the suggestion. + Average time per `double` on Apple M1 Pro (clang 17, random digits, + smaller is better) measured with + [dtoa-benchmark](https://github.com/fmtlib/dtoa-benchmark): -- Improved integer formatting throughput by ~3% + | Method | Time (ns) | + | ----------------------- | --------: | + | fmt (full) | 22.07 | + | fmt (compact) | 29.55 | + | ryu | 35.21 | + | double-conversion | 81.81 | + | `sprintf` | 726.27 | + | `ostringstream` | 864.34 | + +- Improved integer formatting performance by ~3% (https://github.com/fmtlib/fmt/pull/4630). Thanks @user202729. - Optimized formatting into back-insert iterators by using bulk container append/insert methods (e.g. on `std::vector` and custom string types) (https://github.com/fmtlib/fmt/pull/4679). Thanks @user202729. +- Reduced binary size of debug builds (~200k to ~85k in the bloat test) and + improved compile speed when `consteval` is unavailable. + - Made path formatting lossless, preserving ill-formed UTF-16 sequences when converting `std::filesystem::path` to a narrow string. -- Added overloads of `fmt::println` that take a `fmt::text_style` - (https://github.com/fmtlib/fmt/pull/4782). Thanks @ahoarau. - - Added support for formatting `std::unexpected` (https://github.com/fmtlib/fmt/pull/4675). Thanks @17steen. +- Added overloads of `fmt::println` that take a `fmt::text_style` + (https://github.com/fmtlib/fmt/pull/4782). Thanks @ahoarau. + - Added support for positional arguments as width and precision specifiers in `fmt::printf` (https://github.com/fmtlib/fmt/pull/4643). Thanks @KareemOtoum.