First I imrpoved performance of split by replacing the String.split() call with a custom method using StringTokenizer:
final StringTokenizer st = new StringTokenizer(string, separator, true);
String token = null;
String lastToken = separator; //if first token is separator
while (st.hasMoreTokens()) {
token = st.nextToken();
if (token.equals(separator)) {
if (lastToken.equals(separator)) { //no value between 2 separators?
result.add(emptyStrings ? "" : null);
}
} else {
result.add(token);
}
lastToken = token;
}//next token
But this is still not very fast (as it is one of the "hot spots" in my profiling sessions). I wonder if it can go still faster to split strings with ";" as the delimiter?