shlomif/String-Random — pull request #1 by co-me (2014-04-29 05:57:22+00:00)
Title: Cache parsed range patterns

When the number of characters in a range pattern is large, `randregex` becomes slowly.
It is because scanning character table becomes heavy process in this situation.

This patch improves the performance of `randregex` by caching parsed range patterns.

Measurement:

(script)
```
use utf8;
my $generator = String::Random->new;
$generator->randregex('[一-龠]{5}') for 1..1000;
```

(time)
```
before: 3.63s
after: 1.54s
```

(CPU environment)
Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz