Changeset 111133 in webkit


Ignore:
Timestamp:
Mar 18, 2012 9:59:46 AM (12 years ago)
Author:
haraken@chromium.org
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r111132 r111133  
     12012-03-18  Kentaro Hara  <haraken@chromium.org>
     2
     3        Change the initial buffer size of a plain text
     4        https://bugs.webkit.org/show_bug.cgi?id=81192
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        r111109 changed the initial buffer size of a plain text
     9        from 1<<16 to 1<<15 in Chromium/Mac only, for the following reasons:
     10
     11        - As far as I experimented locally, while 1<<15 is better than 1<<16 in Chromium/Mac,
     12        1<<15 and 1<<16 are the same in AppleWebKit/Mac and Chromium/Linux (their performance
     13        "gap" exists at between 1<<17 and 1<<18).
     14        - The reason why I changed 1<<16 to 1<<15 in Chromium/Mac only is that
     15        the value highly depends on the underlying malloc system and I was a bit afraid
     16        that changing to 1<<15 _might_ cause unintentional performance regression in some
     17        platform.
     18
     19        That being said, it seems that 1<<15 would not be worse than 1<<16 in all platforms,
     20        and we should just keep the value consistent. In the first place, according to anttik
     21        (who wrote 1<<16 a long time ago), there was no strong reason for 1<<16.
     22
     23        Based on these observations (See https://bugs.webkit.org/show_bug.cgi?id=81192
     24        for more details), this patch unifies the value to 1<<15 in all platforms.
     25
     26        No tests. No change in behavior.
     27
     28        * editing/TextIterator.cpp:
     29        (WebCore::plainTextToMallocAllocatedBuffer):
     30
    1312012-02-13  Robert Hogan  <robert@webkit.org>
    232
  • trunk/Source/WebCore/editing/TextIterator.cpp

    r111109 r111133  
    25152515
    25162516    // The initial buffer size can be critical for performance: https://bugs.webkit.org/show_bug.cgi?id=81192
    2517 #if PLATFORM(CHROMIUM) && PLATFORM(MAC)
    25182517    static const unsigned cMaxSegmentSize = 1 << 15;
    2519 #else
    2520     static const unsigned cMaxSegmentSize = 1 << 16;
    2521 #endif
    25222518    bufferLength = 0;
    25232519    typedef pair<UChar*, unsigned> TextSegment;
Note: See TracChangeset for help on using the changeset viewer.