Код: Выделить всё
String[] splitValues = s.split("\\u0000");
< /code>
, который называется много. Когда я профилировал это, я увидел, что каждый вызов представлял собой резюме (шаблон), который должен быть составлен и запустить это, что привело к значительному воздействию на производительность. null as \ u0000 Код: Выделить всё
public String[] split(String regex, int limit) {
/* fastpath if the regex is a
(1)one-char String and this character is not one of the
RegEx's meta characters ".$|()[{^?*+\\", or
(2)two-char String and the first char is the backslash and
the second is not the ascii digit or ascii letter.
*/
char ch = 0;
if (((regex.length() == 1 &&
".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) ||
(regex.length() == 2 &&
regex.charAt(0) == '\\' &&
(((ch = regex.charAt(1))-'0')|('9'-ch)) < 0 &&
((ch-'a')|('z'-ch)) < 0 &&
((ch-'A')|('Z'-ch)) < 0)) &&
(ch < Character.MIN_HIGH_SURROGATE ||
ch > Character.MAX_LOW_SURROGATE))
{
Подробнее здесь: https://stackoverflow.com/questions/617 ... sing-regex