Skip to content

Commit 2f0ec97

Browse files
committed
Update included fmt lib to 10.1.0
1 parent d80bbcb commit 2f0ec97

File tree

18 files changed

+3244
-3089
lines changed

18 files changed

+3244
-3089
lines changed

contrib/fmt/LICENSE.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012 - present, Victor Zverovich
1+
Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

contrib/fmt/README.contrib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Source: https://github.com/fmtlib/fmt
2-
Revision: v9.1.0
2+
Revision: v10.1.0

contrib/fmt/README.rst

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -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

8082
See the `documentation <https://fmt.dev>`_ for more details.
@@ -191,24 +193,24 @@ Speed tests
191193
================= ============= ===========
192194
Library 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

203205
The 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
205207
best of three runs. In the test, the format string ``"%0.10f:%04d:%+g:%s:%p:%c:%%\n"``
206208
or equivalent is filled 2,000,000 times with output sent to ``/dev/null``; for
207209
further 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>`_)
212214
and 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
224226
from `format-benchmark <https://github.com/fmtlib/format-benchmark>`_
225227
tests compile time and code bloat for nontrivial projects.
226228
It 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
228230
executable size and compile time (Apple LLVM version 8.1.0 (clang-802.0.42),
229231
macOS 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
245247
size compared to iostreams and comes pretty close to ``printf``. Boost Format
246248
and 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>``
249251
include to measure the overhead of the latter.
250252

251253
**Non-optimized build**
@@ -261,14 +263,14 @@ Boost Format 54.1 365 303
261263
Folly 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
265267
compare formatting function overhead only. Boost Format is a
266268
header-only library so it doesn't provide any linkage options.
267269

268270
Running 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
272274
the 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::
293295
Migrating 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

300305
Projects 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.
470482
Boost 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
474486
strings and positional arguments. Its main drawback is performance. According to
475487
various benchmarks, it is much slower than other methods considered here. Boost
476488
Format 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
479491
FastFormat
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.
483495
However, 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.
495507
Boost 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
499511
completeness. As iostreams, it suffers from the problem of mixing verbatim text
500512
with arguments. The library is pretty fast, but slower on integer formatting
501513
than ``fmt::format_to`` with format string compilation on Karma's own benchmark,
@@ -514,7 +526,7 @@ Documentation License
514526
The `Format String Syntax <https://fmt.dev/latest/syntax.html>`_
515527
section in the documentation is based on the one from Python `string module
516528
documentation <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
518530
Foundation license available in `doc/python-license.txt
519531
<https://raw.github.com/fmtlib/fmt/master/doc/python-license.txt>`_.
520532
It only applies if you distribute the documentation of {fmt}.
@@ -523,8 +535,7 @@ Maintainers
523535
-----------
524536

525537
The {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.
528539
See `Contributors <https://github.com/fmtlib/fmt/graphs/contributors>`_ and
529540
`Releases <https://github.com/fmtlib/fmt/releases>`_ for some of the names.
530541
Let us know if your contribution is not listed or mentioned incorrectly and

contrib/fmt/include/fmt/args.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Formatting library for C++ - dynamic format arguments
1+
// Formatting library for C++ - dynamic argument lists
22
//
33
// Copyright (c) 2012 - present, Victor Zverovich
44
// All rights reserved.

0 commit comments

Comments
 (0)