mirror of
https://github.com/fmtlib/fmt.git
synced 2026-06-15 00:16:15 +08:00
Update changelog
This commit is contained in:
parent
ebb9f0807a
commit
2bab3cc0cc
42
ChangeLog.md
42
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 <fmt/fmt-c.h>
|
||||
|
||||
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<char>` 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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user