@@ -47,7 +47,9 @@ Features
4747* `Format string syntax <https://fmt.dev/latest/syntax.html >`_ similar to Python's
4848 `format <https://docs.python.org/3/library/stdtypes.html#str.format >`_
4949* Fast IEEE 754 floating-point formatter with correct rounding, shortness and
50- round-trip guarantees
50+ round-trip guarantees using the `Dragonbox <https://github.com/jk-jeon/dragonbox >`_
51+ algorithm
52+ * Portable Unicode support
5153* Safe `printf implementation
5254 <https://fmt.dev/latest/api.html#printf-formatting> `_ including the POSIX
5355 extension for positional arguments
@@ -64,7 +66,7 @@ Features
6466 <https://github.com/fmtlib/fmt/tree/master/test> `_ and is `continuously fuzzed
6567 <https://bugs.chromium.org/p/oss-fuzz/issues/list?colspec=ID%20Type%20
6668 Component%20Status%20Proj%20Reported%20Owner%20Summary&q=proj%3Dfmt&can=1> `_
67- * Safety: the library is fully type safe, errors in format strings can be
69+ * Safety: the library is fully type- safe, errors in format strings can be
6870 reported at compile time, automatic memory management prevents buffer overflow
6971 errors
7072* Ease of use: small self-contained code base, no external dependencies,
@@ -74,7 +76,7 @@ Features
7476 consistent output across platforms and support for older compilers
7577* Clean warning-free codebase even on high warning levels such as
7678 ``-Wall -Wextra -pedantic ``
77- * Locale- independence by default
79+ * Locale independence by default
7880* Optional header-only configuration enabled with the ``FMT_HEADER_ONLY `` macro
7981
8082See the `documentation <https://fmt.dev >`_ for more details.
@@ -191,24 +193,24 @@ Speed tests
191193================= ============= ===========
192194Library Method Run Time, s
193195================= ============= ===========
194- libc printf 1.04
195- libc++ std::ostream 3.05
196- {fmt} 6.1.1 fmt::print 0.75
197- Boost Format 1.67 boost::format 7.24
198- Folly Format folly::format 2.23
196+ libc printf 0.91
197+ libc++ std::ostream 2.49
198+ {fmt} 9.1 fmt::print 0.74
199+ Boost Format 1.80 boost::format 6.26
200+ Folly Format folly::format 1.87
199201================= ============= ===========
200202
201- {fmt} is the fastest of the benchmarked methods, ~35 % faster than ``printf ``.
203+ {fmt} is the fastest of the benchmarked methods, ~20 % faster than ``printf ``.
202204
203205The above results were generated by building ``tinyformat_test.cpp `` on macOS
204- 10.14.6 with ``clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT ``, and taking the
206+ 12.6.1 with ``clang++ -O3 -DNDEBUG -DSPEED_TEST -DHAVE_FORMAT ``, and taking the
205207best of three runs. In the test, the format string ``"%0.10f:%04d:%+g:%s:%p:%c:%%\n" ``
206208or equivalent is filled 2,000,000 times with output sent to ``/dev/null ``; for
207209further details refer to the `source
208210<https://github.com/fmtlib/format-benchmark/blob/master/src/tinyformat-test.cc> `_.
209211
210212{fmt} is up to 20-30x faster than ``std::ostringstream `` and ``sprintf `` on
211- floating-point formatting (`dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark >`_)
213+ IEEE754 `` float `` and `` double `` formatting (`dtoa-benchmark <https://github.com/fmtlib/dtoa-benchmark >`_)
212214and faster than `double-conversion <https://github.com/google/double-conversion >`_ and
213215`ryu <https://github.com/ulfjack/ryu >`_:
214216
@@ -224,7 +226,7 @@ The script `bloat-test.py
224226from `format-benchmark <https://github.com/fmtlib/format-benchmark >`_
225227tests compile time and code bloat for nontrivial projects.
226228It generates 100 translation units and uses ``printf() `` or its alternative
227- five times in each to simulate a medium sized project. The resulting
229+ five times in each to simulate a medium- sized project. The resulting
228230executable size and compile time (Apple LLVM version 8.1.0 (clang-802.0.42),
229231macOS Sierra, best of three) is shown in the following tables.
230232
@@ -245,7 +247,7 @@ As you can see, {fmt} has 60% less overhead in terms of resulting binary code
245247size compared to iostreams and comes pretty close to ``printf ``. Boost Format
246248and Folly Format have the largest overheads.
247249
248- ``printf+string `` is the same as ``printf `` but with extra ``<string> ``
250+ ``printf+string `` is the same as ``printf `` but with an extra ``<string> ``
249251include to measure the overhead of the latter.
250252
251253**Non-optimized build **
@@ -261,14 +263,14 @@ Boost Format 54.1 365 303
261263Folly Format 79.9 445 430
262264============= =============== ==================== ==================
263265
264- ``libc ``, ``lib(std)c++ `` and ``libfmt `` are all linked as shared libraries to
266+ ``libc ``, ``lib(std)c++ ``, and ``libfmt `` are all linked as shared libraries to
265267compare formatting function overhead only. Boost Format is a
266268header-only library so it doesn't provide any linkage options.
267269
268270Running the tests
269271~~~~~~~~~~~~~~~~~
270272
271- Please refer to `Building the library `__ for the instructions on how to build
273+ Please refer to `Building the library `__ for instructions on how to build
272274the library and run the unit tests.
273275
274276__ https://fmt.dev/latest/usage.html#building-the-library
@@ -293,18 +295,19 @@ or the bloat test::
293295Migrating code
294296--------------
295297
296- `clang-tidy-fmt <https://github.com/mikecrowe/clang-tidy-fmt >`_ provides clang
297- tidy checks for converting occurrences of ``printf `` and ``fprintf `` to
298- ``fmt::print ``.
298+ `clang-tidy <https://clang.llvm.org/extra/clang-tidy/ >`_ v17 (not yet
299+ released) provides the `modernize-use-std-print
300+ <https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-print.html> `_
301+ check that is capable of converting occurrences of ``printf `` and
302+ ``fprintf `` to ``fmt::print `` if configured to do so. (By default it
303+ converts to ``std::print ``.)
299304
300305Projects using this library
301306---------------------------
302307
303308* `0 A.D. <https://play0ad.com/ >`_: a free, open-source, cross-platform
304309 real-time strategy game
305310
306- * `2GIS <https://2gis.ru/ >`_: free business listings with a city map
307-
308311* `AMPL/MP <https://github.com/ampl/mp >`_:
309312 an open-source library for mathematical programming
310313
@@ -322,8 +325,10 @@ Projects using this library
322325
323326* `ccache <https://ccache.dev/ >`_: a compiler cache
324327
325- * `ClickHouse <https://github.com/ClickHouse/ClickHouse >`_: analytical database
328+ * `ClickHouse <https://github.com/ClickHouse/ClickHouse >`_: an analytical database
326329 management system
330+
331+ * `Contour <https://github.com/contour-terminal/contour/ >`_: a modern terminal emulator
327332
328333* `CUAUV <https://cuauv.org/ >`_: Cornell University's autonomous underwater
329334 vehicle
@@ -360,6 +365,10 @@ Projects using this library
360365
361366* `Knuth <https://kth.cash/ >`_: high-performance Bitcoin full-node
362367
368+ * `libunicode <https://github.com/contour-terminal/libunicode/ >`_: a modern C++17 Unicode library
369+
370+ * `MariaDB <https://mariadb.org/ >`_: relational database management system
371+
363372* `Microsoft Verona <https://github.com/microsoft/verona >`_:
364373 research programming language for concurrent ownership
365374
@@ -389,7 +398,7 @@ Projects using this library
389398 proxy
390399
391400* `redpanda <https://vectorized.io/redpanda >`_: a 10x faster Kafka® replacement
392- for mission critical systems written in C++
401+ for mission- critical systems written in C++
393402
394403* `rpclib <http://rpclib.net/ >`_: a modern C++ msgpack-RPC server and client
395404 library
@@ -413,6 +422,9 @@ Projects using this library
413422* `TrinityCore <https://github.com/TrinityCore/TrinityCore >`_: open-source
414423 MMORPG framework
415424
425+ * `🐙 userver framework <https://userver.tech/ >`_: open-source asynchronous
426+ framework with a rich set of abstractions and database drivers
427+
416428* `Windows Terminal <https://github.com/microsoft/terminal >`_: the new Windows
417429 terminal
418430
@@ -470,7 +482,7 @@ error handling is awkward.
470482Boost Format
471483~~~~~~~~~~~~
472484
473- This is a very powerful library which supports both ``printf ``-like format
485+ This is a very powerful library that supports both ``printf ``-like format
474486strings and positional arguments. Its main drawback is performance. According to
475487various benchmarks, it is much slower than other methods considered here. Boost
476488Format also has excessive build times and severe code bloat issues (see
@@ -479,7 +491,7 @@ Format also has excessive build times and severe code bloat issues (see
479491FastFormat
480492~~~~~~~~~~
481493
482- This is an interesting library which is fast, safe and has positional arguments.
494+ This is an interesting library that is fast, safe, and has positional arguments.
483495However, it has significant limitations, citing its author:
484496
485497 Three features that have no hope of being accommodated within the
@@ -495,7 +507,7 @@ restrictive for using it in some projects.
495507Boost Spirit.Karma
496508~~~~~~~~~~~~~~~~~~
497509
498- This is not really a formatting library but I decided to include it here for
510+ This is not a formatting library but I decided to include it here for
499511completeness. As iostreams, it suffers from the problem of mixing verbatim text
500512with arguments. The library is pretty fast, but slower on integer formatting
501513than ``fmt::format_to `` with format string compilation on Karma's own benchmark,
@@ -514,7 +526,7 @@ Documentation License
514526The `Format String Syntax <https://fmt.dev/latest/syntax.html >`_
515527section in the documentation is based on the one from Python `string module
516528documentation <https://docs.python.org/3/library/string.html#module-string> `_.
517- For this reason the documentation is distributed under the Python Software
529+ For this reason, the documentation is distributed under the Python Software
518530Foundation license available in `doc/python-license.txt
519531<https://raw.github.com/fmtlib/fmt/master/doc/python-license.txt> `_.
520532It only applies if you distribute the documentation of {fmt}.
@@ -523,8 +535,7 @@ Maintainers
523535-----------
524536
525537The {fmt} library is maintained by Victor Zverovich (`vitaut
526- <https://github.com/vitaut> `_) and Jonathan Müller (`foonathan
527- <https://github.com/foonathan> `_) with contributions from many other people.
538+ <https://github.com/vitaut> `_) with contributions from many other people.
528539See `Contributors <https://github.com/fmtlib/fmt/graphs/contributors >`_ and
529540`Releases <https://github.com/fmtlib/fmt/releases >`_ for some of the names.
530541Let us know if your contribution is not listed or mentioned incorrectly and
0 commit comments