|
Boost : |
Subject: Re: [boost] [filesystem] operator == performance
From: Konstantin Litvinenko (to.darkangel_at_[hidden])
Date: 2009-01-19 15:46:16
Beman Dawes wrote:
> Good question.
>
> While the other relationals have to use
> std::lexicographical_compare(), operators == and != can do a simple
> string compare, as you suggest.
>
> SVN trunk updated. It is a bit too late for these changes to make it
> into 1.38.0, however.
>
Thanx!!!
> It would be interesting if you could report back what impact that
> change has on you timings.
There is nothing unexpected to report :). Doing
typedef boost::filesystem::path location_t;
struct location_equal_to : std::binary_function<location_t, location_t,
bool>
{
bool operator()(const location_t& lhs, const location_t& rhs) const
{
return lhs.string() == rhs.string();
}
};
to use location_equal_to predicate in unordered_map, I got no more
do_increment and... remove this bottleneck at all. Can't say about
numbers but this operator == replacement was very helpful.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk