Boost logo

Boost :

Subject: Re: [boost] [convert] Performance
From: Vladimir Batov (Vladimir.Batov_at_[hidden])
Date: 2014-06-10 16:37:07


Oops. Please disregard my reply below. It was meant for the other
pimpl-related thread. My bad.

On 06/11/2014 06:33 AM, Vladimir Batov wrote:
> Alex, I was planning on replying by Rob bit me to it pretty much
> expressing my view. My strong "attachment" to ref.-counted "Pimpl" is
> probably stems from the fact that I've always treated it as
> another/handier name for Handly/Body. Strangely, in all these years of
> deploying my-pimpl no one (including Sutter) "corrected" me on that...
> until now. :-(
>
> On 06/10/2014 11:43 PM, alex wrote:
>>> Then I run
>>>
>>> for (int k = 0; k < num_tries; ++k)
>>> {
>>> double cnv_time = performance::str_to_int(strings,
>>> boost::cnv::spirit());
>>> double raw_time = performance_string_to_int_spirit(strings);
>>>
>>> printf("str-to-int spirit: raw/cnv=%.2f/%.2f seconds
>>> (%.2f%%).\n",
>>> raw_time, cnv_time, 100 * cnv_time / raw_time);
>>> }
>>>
>>> and regardless if I calculate cnv_time first or raw_time first I get
>>> the
>>> same results (i.e. the first call does not help the second call at
>>> all) as
>>> below:
>>>
>>> str-to-int spirit: raw/cnv=1.46/1.42 seconds (97.34%).
>>> str-to-int spirit: raw/cnv=1.47/1.42 seconds (96.15%).
>>> str-to-int spirit: raw/cnv=1.46/1.42 seconds (97.31%).
>>> str-to-int spirit: raw/cnv=1.45/1.42 seconds (97.45%).
>>> str-to-int spirit: raw/cnv=1.45/1.41 seconds (97.30%).
>>>
>>> I give up. My brain is too puny to understand that.
>>>
>> Where performance::str_to_int does
>>
>> BOOST_ASSERT(parse() ), and
>> BOOST_ASSERT(i == str.end())
>>
>> performance_string_to_int_spirit does
>>
>> if !parse() return false.
>> return i == str.end()
>>
>> Could it be that the assert function adds some overhead (passing the
>> filename and linenumber), which explains the difference ?
>>
>> Alex
>>
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost


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