Why does the long string have to be split into individual containers? Can you work with the large string, just in segments at offset multiples of five?
unpack is already lightning fast, but even less work is being done if you can avoid making a copies. Of course this is Perl, and sometimes the more idiomatic approaches (unpack, for example) can be faster than algorithmic approaches (walking through the existing string without making copies), but if unpack is still too slow, and if what you are using those little substrings for could be done in-place, it might be worth attempting a solution that works on the original string.
Dave
In reply to Re: Performance problems on splitting long strings
by davido
in thread Performance problems on splitting long strings
by Laurent_R
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |