Boost logo

Boost :

Subject: Re: [boost] [xint] Performance of fixed-size large integers
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2011-03-04 02:10:04


On Thu, 03 Mar 2011 19:04:44 +0000
"Phil Endecott" <spam_from_boost_dev_at_[hidden]> wrote:

> [...] The docs' front page has a link under "Detailed Usage
> Information" to "Fixed-Length Integers" - which is not really very
> detailed, and has examples in the notes like "integer_t<8>" that
> don't work. I established quickly enough that the correct syntax is
> integer_t<fixedlength<8>>.

Apologies, that was left over from an earlier iteration of the library
and has now been corrected.

> Also I noted that the conventions here don't match the built-in
> (u)intN_t types, i.e. int64_t vs. int63_t and the "wrap-around"
> behaviour. Perhaps there is some rationale for this, but I would be
> happier to see it consistent with the built-in types. [...]

Sorry, but the library doesn't use two's complement representation
(there's no high-bit on arbitrary-length integers, so it can't), so
that would only be possible with code specifically written for
fixed-length integers.

> [...] It seems to me that that is several hundred times faster than
> the Xint code (on my 1.2 GHz ARM test system). [...] This is about
> half the speed of the assembler, but still hundreds of times faster
> than the Xint code. [...]

I'll be happy to accept patches.

> I don't want to write a review that says "This library doesn't do
> what I want, therefore it should be rejected". No doubt others will
> find applications where it will be useful. But I think the
> performance when used for fixed-size integers should be investigated.

Fixed-size integers are definitely second-class citizens right now,
simply due to time and manpower constraints. As the library matures, I
think you'll see serious efficiency improvements.

-- 
Chad Nelson
Oak Circle Software, Inc.
*
*
*



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk