develooper Front page | perl.perl5.porters | Postings from November 2017

Re: word-at-a-time searching for UTF-8 invariants

Thread Previous | Thread Next
From:
Sawyer X
Date:
November 19, 2017 09:59
Subject:
Re: word-at-a-time searching for UTF-8 invariants
Message ID:
c92e202e-8d7b-21b8-ebab-8a445a60ef7b@gmail.com


On 11/16/2017 08:03 PM, Karl Williamson wrote:
> I have pushed a branch for review at
>
> https://perl5.git.perl.org/perl.git/shortlog/refs/heads/smoke-me/khw-invariant
>
>
> which changes is_utf8_invariant_string_loc() (and hence
> is_utf8_invariant_string(), which is defined as a special case of the
> former) to use word-at-a-time (instead of per-byte) parsing through
> the input string.
>
> This is commonly used functionality for parsing strings to decide if
> they are UTF-8 and need to have the UTF-8 flag on.
>
> [...]
>
>
> This means, for example, that the COND measurement is 800% faster.

Impressive!

What kind of user code would enjoy this speed up?

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About