in reply to Performance problems on splitting long strings

You would have to benchmark this to be sure, but you might try spliting on '' to get a char array then shift or splice off multiples of 5 chars at a time. (Though I suspect unpack will be faster.)

It helps to remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.