Bug 636655 - Back out bug 582852 because of the performance regression it caused in creating large textnodes (while it was supposed to improve the performance); r,a=bzbarsky

This commit is contained in:
Ehsan Akhgari 2011-02-28 13:04:59 -08:00
parent 9626543cf1
commit 8b39b5256b

View File

@ -202,18 +202,13 @@ nsTextFragment::SetTo(const PRUnichar* aBuffer, PRInt32 aLength)
}
}
// We don't attempt to detect if large text nodes can be stored compactly,
// because that wastes too much time.
const PRInt32 LARGE_STRING_THRESHOLD = 10240; // 10KB
PRBool need2 = aLength >= LARGE_STRING_THRESHOLD;
if (!need2) {
// See if we need to store the data in ucs2 or not
while (ucp < uend) {
PRUnichar ch = *ucp++;
if (ch >= 256) {
need2 = PR_TRUE;
break;
}
// See if we need to store the data in ucs2 or not
PRBool need2 = PR_FALSE;
while (ucp < uend) {
PRUnichar ch = *ucp++;
if (ch >= 256) {
need2 = PR_TRUE;
break;
}
}