You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Travis Vitek <Tr...@roguewave.com> on 2008/04/18 23:30:35 UTC
RE: svn commit: r649673 - /stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
>
>Author: sebor
>Date: Fri Apr 18 13:04:21 2008
>New Revision: 649673
>
>
> nio.imbue (loc);
>- nsb.pubsetg (data.ncs_, RW_COUNT_OF (data.ncs_));
>+ nsb.pubsetg (data.ncs_, Traits::length (data.ncs_));
>
Should we calculate the length once in the main thread and cache it?
Seems like this would save some cycles in each thread and increase
contention for any locks in the locale code.
Travis
Re: svn commit: r649673 - /stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
Posted by Martin Sebor <se...@roguewave.com>.
This is done:
http://svn.apache.org/viewvc?view=rev&revision=653942
Btw., while there, I noticed that the test generates sequences
at most two digits long, with no thousands separator or decimal
points. It would be good to enhance it to test those formats as
well.
Martin
Martin Sebor wrote:
> Travis Vitek wrote:
>>
>>
>>> Author: sebor
>>> Date: Fri Apr 18 13:04:21 2008
>>> New Revision: 649673
>>>
>>>
>>> nio.imbue (loc);
>>> - nsb.pubsetg (data.ncs_, RW_COUNT_OF (data.ncs_));
>>> + nsb.pubsetg (data.ncs_, Traits::length (data.ncs_));
>>>
>>
>> Should we calculate the length once in the main thread and cache it?
>> Seems like this would save some cycles in each thread and increase
>> contention for any locks in the locale code.
>
> Good suggestion! Let me fix it.
>
> Martin
Re: svn commit: r649673 - /stdcxx/trunk/tests/localization/22.locale.num.get.mt.cpp
Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>
>
>> Author: sebor
>> Date: Fri Apr 18 13:04:21 2008
>> New Revision: 649673
>>
>>
>> nio.imbue (loc);
>> - nsb.pubsetg (data.ncs_, RW_COUNT_OF (data.ncs_));
>> + nsb.pubsetg (data.ncs_, Traits::length (data.ncs_));
>>
>
> Should we calculate the length once in the main thread and cache it?
> Seems like this would save some cycles in each thread and increase
> contention for any locks in the locale code.
Good suggestion! Let me fix it.
Martin