Files
multiprecision/doc/performance.qbk
ivanpanch 55bf069621 Fix mistakes (#729)
* Update Jamfile.v2

* Update introduction.qbk

* Update tutorial.qbk

* Update tutorial_cpp_int.qbk

* Update tutorial_gmp_int.qbk

* Update tutorial_tommath.qbk

* Update integer_examples.cpp

* Update tutorial_cpp_bin_float.qbk

* Update tutorial_cpp_dec_float.qbk

* Update tutorial_gmp_float.qbk

* Update tutorial_mpfr_float.qbk

* Update tutorial_float128.qbk

* Update tutorial_float_builtin_ctor.qbk

* Update big_seventh.cpp

* Update tutorial_float_eg.qbk

* Update floating_point_examples.cpp

* Update mpfr_precision.cpp

* Update gauss_laguerre_quadrature.cpp

* Update tutorial_interval_mpfi.qbk

* Update tutorial_cpp_complex.qbk

* Update tutorial_mpc_complex.qbk

* Update tutorial_float128_complex.qbk

* Update tutorial_complex_adaptor.qbk

* Update tutorial_rational.qbk

* Update tutorial_tommath_rational.qbk

* Update tutorial_logged_adaptor.qbk

* Update tutorial_debug_adaptor.qbk

* Update tutorial_visualizers.qbk

* Update tutorial_fwd.qbk

* Update tutorial_conversions.qbk

* Update tutorial_random.qbk

* Update random_snips.cpp

* Update tutorial_constexpr.qbk

* Update tutorial_import_export.qbk

* Update cpp_int_import_export.cpp

* Update tutorial_mixed_precision.qbk

* Update tutorial_variable_precision.qbk

* Update scoped_precision_example.cpp

* Update tutorial_numeric_limits.qbk

* Update tutorial_numeric_limits.qbk

* Update numeric_limits_snips.cpp

* Update numeric_limits_snips.cpp

* Update tutorial_numeric_limits.qbk

* Update numeric_limits_snips.cpp

* Update numeric_limits_snips.cpp

* Update tutorial_io.qbk

* Update reference_number.qbk

* Update reference_cpp_bin_float.qbk

* Update reference_cpp_double_fp_backend.qbk

* Update reference_internal_support.qbk

* Update reference_backend_requirements.qbk

* Update performance.qbk

* Update performance_overhead.qbk

* Update performance_real_world.qbk

* Update performance_integer_real_world.qbk

* Update performance_rational_real_world.qbk

* Update reference_number.qbk

* Update tutorial_numeric_limits.qbk

* Update reference_backend_requirements.qbk
2025-08-18 13:14:39 +02:00

73 lines
2.9 KiB
Plaintext

[/
Copyright 2011 - 2020 John Maddock.
Copyright 2013 - 2019 Paul A. Bristow.
Copyright 2013 Christopher Kormanyos.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt.)
]
[section:perf Performance Comparison]
In the beginning of the project and throughout,
many performance analyses, counts of multiprecision-operations-per-second
and the like have been performed.
Some of these are already listed in the ensuing sections.
We will now provide some general notes on performance, valid
for all of the multiprecision backends, before the detailed
benchmarks of the following sections.
The header-only, library-independent Boost-licenses integer
and floating-point backends including
__cpp_int for multiprecision integers,
__cpp_bin_float and __cpp_dec_float for multiprecision floating-point types
are significantly slower than the world's fastest implementations
generally agreed to be found in GMP/MPIR, MPFR and MPC (which are based on GMP).
Complex types __cpp_complex that are synthesized from these types
share similar relative performances.
The backends which effectively wrap GMP/MPIR and MPFR
retain the superior performance of the low-level big-number engines.
When these are used (in association with at least some level of optimization)
they achieve and retain the expected low-level performances.
At low digit counts, however, it is noted that the performances of __cpp_int,
__cpp_bin_float and __cpp_dec_float can actually meet or exceed
those encountered for GMP/MPIR, MPFR, etc. The reason for this
is because stack allocation and/or the use of fast container
storage can actually out-perform the allocation mechanisms in
GMP/MPIR, which dominate run-time costs at low digit counts.
As digit counts rise above about 50 or so, however,
GMP/MPIR performance steadily increases,
and simultaneously increases beyond (in relation to)
the performances of the Boost-licensed, self-written backends.
At around a few hundred to several thousands of digits,
factors of about two through five are observed,
whereby GMP/MPIR-based calculations are (performance-wise)
superior ones.
At a few thousand decimal digits, the upper end of
the Boost backends is reached. At the moment,
advanced big-number multiplication schemes in the
Boost-licensed, self-written backends is limited
to school multiplication and Karatsuba multiplication.
Higher-orders of Toom-Cook and FFT-based multiplication
are not (yet) implemented. So it is not yet
feasible to perform mega-digit calculations
with the Boost-licensed, self-written backends,
whereas these are readily possible with
the GMP/MPIR and MPRF based backends.
[include performance_overhead.qbk]
[include performance_real_world.qbk]
[include performance_integer_real_world.qbk]
[include performance_rational_real_world.qbk]
[include performance_float.qbk]
[include performance_integer.qbk]
[include performance_rational.qbk]
[endsect]