Q about ctype.narrow

Paolo Carlini pcarlini@unitus.it
Wed Nov 26 15:49:00 GMT 2003


Paolo Carlini wrote:

> Wouldn't that be also quite useful in order to speed up many 
> applications of
> widen and narrow?

Of course, I see clearly that in this case we don't save to virtual function
call cost, we save only the wctob/btowc cost. In the case of the array 
version,
the former would be typically amortized over many chars, though.

Overall, taking into account the *extreme* semplicity of this baseline 
caching
mechanism, it should probably be applied systematically if the sophisticated
solutions which are being discusses are not available.

Jerry (Pétur?) just let us know your timings for the general caching 
solution,
ok? And don't forget that we are also interested in speeding up 
ctype::do_is:
Pétur filed a neat PR about it.

Paolo.



More information about the Libstdc++ mailing list