Subject: [Boost-bugs] [Boost C++ Libraries] #11590: cpp_int initialization inefficient
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-08-27 12:50:08
#11590: cpp_int initialization inefficient
------------------------------------------+----------------------------
Reporter: Manfred Weis <manfredweis@â¦> | Owner: johnmaddock
Type: Patches | Status: new
Milestone: To Be Determined | Component: multiprecision
Version: Boost 1.57.0 | Severity: Optimization
Keywords: |
------------------------------------------+----------------------------
I tried to create an cpp_int with about 10 million digits from a hex
string "0x1....1"; it literally take ages.
The reasons seems to be the repeated shift and add conversion from the
characters; while that is inevitable for decimal digits, a hex encoded
string would allow to directly determine the final position and shift in
the corresponding limb.
TODO: check supplied string for valid hex encoding, allocate enough zero-
initialized limbs and then directly set the value of the corresponding
limb.
A further improvement would be to supply a conversion from a sequence of
values that are stored in some linear container.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11590> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC