A DESCRIPTION OF THE PROBLEM :
It's currently difficult to make the most of the String.split() fast path when dealing with delimiters that are not known ahead of time, and may be more than one character. `Pattern.quote()` uses Q/E escaping, so always emits a pattern that's unable to take the fast path, so in performance sensitive cases you wind up having to write code that's aware of of the fast path decide whether it's better to cache a pattern and use `Pattern.split()` or call `String.split()`.
At least if `Pattern.quote` were to handle a single character delimiter in a way compatible with the fast path, it might simplify writing logic to decide whether `String.split()` or `Pattern.split()` is the more profitable path:
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L3417-L3426
It's currently difficult to make the most of the String.split() fast path when dealing with delimiters that are not known ahead of time, and may be more than one character. `Pattern.quote()` uses Q/E escaping, so always emits a pattern that's unable to take the fast path, so in performance sensitive cases you wind up having to write code that's aware of of the fast path decide whether it's better to cache a pattern and use `Pattern.split()` or call `String.split()`.
At least if `Pattern.quote` were to handle a single character delimiter in a way compatible with the fast path, it might simplify writing logic to decide whether `String.split()` or `Pattern.split()` is the more profitable path:
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L3417-L3426