On 09/05/2012 09:03 PM, Stefan Teleman wrote:
> On Wed, Sep 5, 2012 at 10:55 PM, Martin Sebor <msebor@gmail.com> wrote:
>
>> I suspect the difference is due to the overhead of the repeated
>> initialization and destruction of the per-object mutex in the
>> test. The test repeatedly creates (and discards) named locale
>> objects.
>>
>> The per-class mutex is initialized just once in the process, no
>> matter how many facet objects (how many distinct named locales)
>> the test creates. But the per-object mutex must be created (and
>> destroyed) for each named locale.
>
> Agreed.
>
> But: if the choice is between an implementation which [1] breaks ABI
> and [2] performs 20% worse -- even in contrived test cases -- than
> another implementation [2] which doesn't break ABI, and performs
> better than the first one, why would we even consider the first one?
Breaking the ABI is not an option (unless we rev the version).
But I'm not sure I understand what you think breaks the ABI.
We don't need to add a new mutex -- we can use the __rw_facet
member for the locking. Or did you mean something else?
Martin
>
> --Stefan
>
|