Re: Use case for utf8::upgrade?

2010-04-08 02:27:19
Am 08.04.2010 um 01:25 schrieb Aristotle Pagaltzis:

* Gisle Aas <gisle(_at_)aas(_dot_)no> [2010-04-08 00:00]:
This fix was withdrawn from 5.12.0. Currently you have to "use
feature 'unicode_strings'" to get the sane behaviour in the
current lexical scope. [...] This means that the utf8::upgrade()
advice also applies to perl-5.12.0.


Well, using `use feature 'unicode_strings';` and not upgrading
strings is a better strategy for code that doesn’t need to work
under earlier perl versions


since upgrading a string increases memory consumption and can significantly 
slow down regex matches against it.

Is it some copying behind the scenes that increases memory consumption?

Why does that have the potential to significantly slow down regex matches?

Does that mean that when doing lots of matching, it might be preferable to use 
byte strings and byte semantics, not character strings and character semantics?

Under older perls, it’s a question of getting the wrong results
in less time and memory, so there’s not an option.

Wrong results? Could you clarify? Thanks :-)

Michael.Ludwig (#)

<Prev in Thread] Current Thread [Next in Thread>