in reply to Performance problems on splitting long strings
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Performance problems on splitting long strings
by AnomalousMonk (Archbishop) on Jan 31, 2014 at 22:24 UTC | |
|
Re^2: Performance problems on splitting long strings
by Laurent_R (Canon) on Jan 31, 2014 at 01:10 UTC | |
by boftx (Deacon) on Jan 31, 2014 at 01:25 UTC | |
by hdb (Monsignor) on Jan 31, 2014 at 07:21 UTC | |
by Laurent_R (Canon) on Jan 31, 2014 at 07:39 UTC |