Boost logo

Boost :

Subject: Re: [boost] [container] boost::container::vector, hybrid_vector, and performance
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2013-02-12 16:38:33


El 12/02/2013 17:15, igaztanaga_at_[hidden] escribió:
> El 12/02/2013 16:15, Andrew Hundt escribió:
>> The OS X + clang version was on 1.52, Adam will need to chime in for the
>> others.
>>
>> Cheers!
>> Andrew Hundt

Adam, Andrew, I've committed changeset #82846, adding to trunk some
performance improvements in vector's constructors. It should improve a
bit boost::container::vector results.

I saw that varray has some optimizations for trivial types (dispatching
to memcpy) that boost::container misses. Maybe a fairer comparison would
be to use a simple class instead of std::size_t as the basic type.
Something like "copyable_int" in boost/libs/container/movable_int.hpp:

class copyable_int
{
    public:
    copyable_int()
       : m_int(0)
    {}

    explicit copyable_int(int a)
       : m_int(a)
    {}

    copyable_int(const copyable_int& mmi)
       : m_int(mmi.m_int)
    {}

    copyable_int & operator= (int i)
    { this->m_int = i; return *this; }

    //...

    private:
    int m_int;
};

Best,

Ion


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