зеркало из https://github.com/mozilla/gecko-dev.git
PLIF::Service::XML::Char() was the most expensive function in a typical profile. This takes it completely off the radar by not bothering to merge adjacent strings.
This commit is contained in:
Родитель
c4844719b2
Коммит
0ac4b20d8e
|
@ -185,16 +185,7 @@ sub End {
|
||||||
|
|
||||||
sub Char {
|
sub Char {
|
||||||
my $parser = shift;
|
my $parser = shift;
|
||||||
my($text) = @_;
|
push(@{$parser->{'Current List'}}, 0 => @_);
|
||||||
my $currentList = $parser->{'Current List'};
|
|
||||||
my $position = $#$currentList;
|
|
||||||
if (($position > 0) and ($currentList->[$position-1] eq '0')) {
|
|
||||||
# we already have some text, just stick it on the end
|
|
||||||
$currentList->[$position] .= $text;
|
|
||||||
} else {
|
|
||||||
# new text node
|
|
||||||
push(@$currentList, 0 => $text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sub Final {
|
sub Final {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче