Title: [111133] trunk/Source/WebCore
Revision
111133
Author
[email protected]
Date
2012-03-18 09:59:46 -0700 (Sun, 18 Mar 2012)

Log Message

Change the initial buffer size of a plain text
https://bugs.webkit.org/show_bug.cgi?id=81192

Reviewed by Dimitri Glazkov.

r111109 changed the initial buffer size of a plain text
from 1<<16 to 1<<15 in Chromium/Mac only, for the following reasons:

- As far as I experimented locally, while 1<<15 is better than 1<<16 in Chromium/Mac,
1<<15 and 1<<16 are the same in AppleWebKit/Mac and Chromium/Linux (their performance
"gap" exists at between 1<<17 and 1<<18).
- The reason why I changed 1<<16 to 1<<15 in Chromium/Mac only is that
the value highly depends on the underlying malloc system and I was a bit afraid
that changing to 1<<15 _might_ cause unintentional performance regression in some
platform.

That being said, it seems that 1<<15 would not be worse than 1<<16 in all platforms,
and we should just keep the value consistent. In the first place, according to anttik
(who wrote 1<<16 a long time ago), there was no strong reason for 1<<16.

Based on these observations (See https://bugs.webkit.org/show_bug.cgi?id=81192
for more details), this patch unifies the value to 1<<15 in all platforms.

No tests. No change in behavior.

* editing/TextIterator.cpp:
(WebCore::plainTextToMallocAllocatedBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (111132 => 111133)


--- trunk/Source/WebCore/ChangeLog	2012-03-18 11:33:04 UTC (rev 111132)
+++ trunk/Source/WebCore/ChangeLog	2012-03-18 16:59:46 UTC (rev 111133)
@@ -1,3 +1,33 @@
+2012-03-18  Kentaro Hara  <[email protected]>
+
+        Change the initial buffer size of a plain text
+        https://bugs.webkit.org/show_bug.cgi?id=81192
+
+        Reviewed by Dimitri Glazkov.
+
+        r111109 changed the initial buffer size of a plain text
+        from 1<<16 to 1<<15 in Chromium/Mac only, for the following reasons:
+
+        - As far as I experimented locally, while 1<<15 is better than 1<<16 in Chromium/Mac,
+        1<<15 and 1<<16 are the same in AppleWebKit/Mac and Chromium/Linux (their performance
+        "gap" exists at between 1<<17 and 1<<18).
+        - The reason why I changed 1<<16 to 1<<15 in Chromium/Mac only is that
+        the value highly depends on the underlying malloc system and I was a bit afraid
+        that changing to 1<<15 _might_ cause unintentional performance regression in some
+        platform.
+
+        That being said, it seems that 1<<15 would not be worse than 1<<16 in all platforms,
+        and we should just keep the value consistent. In the first place, according to anttik
+        (who wrote 1<<16 a long time ago), there was no strong reason for 1<<16.
+
+        Based on these observations (See https://bugs.webkit.org/show_bug.cgi?id=81192
+        for more details), this patch unifies the value to 1<<15 in all platforms.
+
+        No tests. No change in behavior.
+
+        * editing/TextIterator.cpp:
+        (WebCore::plainTextToMallocAllocatedBuffer):
+
 2012-02-13  Robert Hogan  <[email protected]>
 
         CSS 2.1 failure: eof-003.htm fails

Modified: trunk/Source/WebCore/editing/TextIterator.cpp (111132 => 111133)


--- trunk/Source/WebCore/editing/TextIterator.cpp	2012-03-18 11:33:04 UTC (rev 111132)
+++ trunk/Source/WebCore/editing/TextIterator.cpp	2012-03-18 16:59:46 UTC (rev 111133)
@@ -2514,11 +2514,7 @@
     UChar* result = 0;
 
     // The initial buffer size can be critical for performance: https://bugs.webkit.org/show_bug.cgi?id=81192
-#if PLATFORM(CHROMIUM) && PLATFORM(MAC)
     static const unsigned cMaxSegmentSize = 1 << 15;
-#else
-    static const unsigned cMaxSegmentSize = 1 << 16;
-#endif
     bufferLength = 0;
     typedef pair<UChar*, unsigned> TextSegment;
     OwnPtr<Vector<TextSegment> > textSegments;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to