From 740385d636699d3ac5d50046c6780015917bc489 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 24 Oct 2020 11:18:33 -0700 Subject: [PATCH] Update changelog --- ChangeLog.rst | 142 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 118 insertions(+), 24 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 449179cf..e8860a09 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -1,7 +1,40 @@ 7.1.0 - TBD ----------- -* Added a formatter for ``std::chrono::time_point``: +* Switched from Grisu3 to `Dragonbox `_ + for the default floating-point formatting which gives the shortest decimal + representation with round-trip and correct rounding guarantees + (`#1882 `_, + `#1887 `_, + `#1894 `_). This makes {fmt} up to + 20-30x faster than common implementations of ``std::ostringstream`` and + ``sprintf`` on `dtoa-benchmark `_ + and faster than double-conversion and ryu: + + .. image:: https://user-images.githubusercontent.com/576385/ + 95684665-11719600-0ba8-11eb-8e5b-972ff4e49428.png + + It is possible to get even better performance at the cost of larger binary + size by compiling with the ``FMT_USE_FULL_CACHE_DRAGONBOX`` macro set to 1. + + Thanks `@jk-jeon (Junekey Jeon) `_. + +* Added an experimental unsynchronized file output API which, together with + the format string compilation, can give `5-9 times speed up compared to + fprintf `_ + on common platforms (`godbolt `__): + + .. code:: c++ + + #include + + int main() { + auto f = fmt::output_file("guide"); + f.print("The answer is {}.", 42); + } + +* Added a formatter for ``std::chrono::time_point`` + (`godbolt `__): .. code:: c++ @@ -14,24 +47,10 @@ Thanks `@adamburgess (Adam Burgess) `_. -* Added an experimental unsynchronized file output API which, together with - the format string compilation, can give `5-9 times speed up compared to - fprintf `_ - on common platforms: - - .. code:: c++ - - #include - - int main() { - auto f = fmt::output_file("guide"); - f.print("The answer is {}.", 42); - } - * Added support for ranges with non-const ``begin``/``end`` to ``fmt::join`` (`#1784 `_, - `#1786 `_) For example - (`godbolt `__): + `#1786 `_). For example + (`godbolt `__): .. code:: c++ @@ -133,6 +152,20 @@ MY_LOG("invalid squishiness: {}", 42); +* Replaced ``snprintf`` fallback with a faster internal IEEE 754 ``float`` and + ``double`` formatter for arbitrary precision. For example + (`godbolt `__): + + .. code:: c++ + + #include + + int main() { + fmt::print("{:.500}\n", 4.9406564584124654E-324); + } + + prints 4.9406564584124654417656879286822137236505980261432476442558568250067550727020875186529983636163599237979656469544571773092665671035593979639877479601078187812630071319031140452784581716784898210368871863605699873072305000638740915356498438731247339727316961514003171538539807412623856559117102665855668676818703956031062493194527159149245532930545654440112748012970999954193198940908041656332452475714786901472678015935523861155013480352649347201937902681071074917033322268447533357208324319360923829e-324. + * Made ``format_to_n`` and ``formatted_size`` part of the `core API `__ (`godbolt `__): @@ -146,6 +179,43 @@ auto end = fmt::format_to_n(buf, sizeof(buf), "{}", 42); } +* Added ``fmt::format_to_n`` overload with format string compilation + (`#1764 `_, + `#1767 `_, + `#1869 `_). For example + (`godbolt `__): + + .. code:: c++ + + #include + + int main() { + char buf[8]; + fmt::format_to_n(buf, sizeof(buf), FMT_COMPILE("{}"), 42); + } + + Thanks `@Kurkin (Dmitry Kurkin) `_, + `@alexezeder (Alexey Ochapov) `_. + +* Added ``fmt::format_to`` overload that take ``text_style`` + (`#1593 `_, + `#1842 `_, + `#1843 `_). For example + (`godbolt `__): + + .. code:: c++ + + #include + + int main() { + std::string out; + fmt::format_to(std::back_inserter(out), + fmt::emphasis::bold | fg(fmt::color::red), + "The answer is {}.", 42); + } + + Thanks `@Naios (Denis Blank) `_. + * Made `#` emit trailing zeros. For example (`godbolt `__): @@ -165,8 +235,10 @@ `#1829 `_). Thanks `@alexezeder (Alexey Ochapov) `_. -* Added support for the append mode to the experimental file API - (`#1847 `_). +* Added support for the append mode to the experimental file API and + improved ``fcntl.h`` detection. + (`#1847 `_, + `#1848 `_). Thanks `@t-wiser `_. * Fixed handling of types that have both an implicit conversion operator and @@ -177,14 +249,24 @@ (`#1822 `_). Thanks `@BRevzin (Barry Revzin) `_. +* Improved ``FMT_ALWAYS_INLINE`` + (`#1878 `_). + Thanks `@jk-jeon (Junekey Jeon) `_. + +* Optimized counting of decimal digits on MSVC + (`#1890 `_). + Thanks `@mwinterb `_. + * Improved documentation (`#1772 `_, `#1775 `_, `#1792 `_, - `#1838 `_). + `#1838 `_, + `#1888 `_). Thanks `@leolchat (Léonard Gérard) `_, `@pepsiman (Malcolm Parsons) `_, - `@Klaim (Joël Lamotte) `_. + `@Klaim (Joël Lamotte) `_, + `@ravijanjam (Ravi J) `_. * Added the ``FMT_REDUCE_INT_INSTANTIATIONS`` CMake option that reduces the binary code size at the cost of some integer formatting performance. This can @@ -193,7 +275,7 @@ `#1781 `_). Thanks `@kammce (Khalil Estell) `_. -* Build configuration improvements +* Improved build configuration (`#1760 `_, `#1770 `_, `#1779 `_, @@ -217,14 +299,26 @@ `#1817 `_, `#1818 `_, `#1825 `_, - `#1836 `_). + `#1836 `_, + `#1855 `_, + `#1856 `_, + `#1860 `_, + `#1877 `_, + `#1879 `_, + `#1880 `_). Thanks `@TheQwertiest `_, `@medithe `_, `@martinwuehrer (Martin Wührer) `_, `@n16h7hunt3r `_, `@Othereum (Seokjin Lee) `_, `@gsjaardema (Greg Sjaardema) `_, - `@AlexanderLanin (Alexander Lanin) `_. + `@AlexanderLanin (Alexander Lanin) `_, + `@gcerretani (Giovanni Cerretani) `_, + `@chronoxor (Ivan Shynkarenka) `_, + `@noizefloor (Jan Schwers) `_, + `@akohlmey (Axel Kohlmeyer) `_, + `@jk-jeon (Junekey Jeon) `_, + `@rimathia `_. 7.0.3 - 2020-08-06 ------------------