<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>35336</bug_id>
          
          <creation_ts>2010-02-24 03:19:18 -0800</creation_ts>
          <short_desc>Optimize Font::normalizeSpaces()</short_desc>
          <delta_ts>2010-02-24 22:56:48 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Andreas Kling">kling</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>benjamin</cc>
    
    <cc>commit-queue</cc>
    
    <cc>kenneth</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>193286</commentid>
    <comment_count>0</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-02-24 03:19:18 -0800</bug_when>
    <thetext>This function is called quite a lot and is trivial to optimize.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193287</commentid>
    <comment_count>1</comment_count>
      <attachid>49373</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-02-24 03:20:45 -0800</bug_when>
    <thetext>Created attachment 49373
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193301</commentid>
    <comment_count>2</comment_count>
      <attachid>49373</attachid>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-02-24 04:28:23 -0800</bug_when>
    <thetext>Comment on attachment 49373
Proposed patch

The changelog should explain what change you made and not just say &quot;optimized Font::normalizeSpace()&quot;.

Apart from that LGTM</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193305</commentid>
    <comment_count>3</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2010-02-24 04:46:46 -0800</bug_when>
    <thetext>Is there any measured speedup on benchmarks or microbenchmarks?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193308</commentid>
    <comment_count>4</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-02-24 05:10:04 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; Is there any measured speedup on benchmarks or microbenchmarks?

Tested with the NASM manual (!), I get these insn fetch counts with callgrind:

Before: 18492923
After: 16805832</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193309</commentid>
    <comment_count>5</comment_count>
      <attachid>49379</attachid>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-02-24 05:11:00 -0800</bug_when>
    <thetext>Created attachment 49379
Same patch with fleshed-out ChangeLog</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193322</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2010-02-24 05:54:09 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Is there any measured speedup on benchmarks or microbenchmarks?
&gt; 
&gt; Tested with the NASM manual (!), I get these insn fetch counts with callgrind:
&gt; 
&gt; Before: 18492923
&gt; After: 16805832

That&apos;s not really what I meant.  I meant are there any benchmarks (HTML content) where this improves page loading or rending time.  I am not even sure what you are testing with the callgrind data.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193323</commentid>
    <comment_count>7</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-02-24 05:56:44 -0800</bug_when>
    <thetext>I believe he was testing some of our reference sites (slashdot.org etc), and this one came up as one of the top ones in the profiling. That should have been a bit more clear in the bug report.

Could you please comment Andreas?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193326</commentid>
    <comment_count>8</comment_count>
    <who name="Andreas Kling">kling</who>
    <bug_when>2010-02-24 06:04:06 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; I believe he was testing some of our reference sites (slashdot.org etc), and
&gt; this one came up as one of the top ones in the profiling. That should have been
&gt; a bit more clear in the bug report.

This is correct, my apologies for being excessively terse.

I was basically profiling some reference pages with callgrind and looking at the top 5 (or so) functions for page loading, rendering and scrolling.

This particular function showed up on the page loading profiles, so I took a quick look at it and saw an obvious optimization.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193327</commentid>
    <comment_count>9</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2010-02-24 06:08:11 -0800</bug_when>
    <thetext>Do you see an improvement in speed with the patch (in ms please)?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193368</commentid>
    <comment_count>10</comment_count>
      <attachid>49379</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2010-02-24 08:21:42 -0800</bug_when>
    <thetext>Comment on attachment 49379
Same patch with fleshed-out ChangeLog

Does this cause measurable speedup?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193378</commentid>
    <comment_count>11</comment_count>
    <who name="Benjamin Poulain">benjamin</who>
    <bug_when>2010-02-24 08:43:12 -0800</bug_when>
    <thetext>(In reply to comment #10)
&gt; (From update of attachment 49379 [details])
&gt; Does this cause measurable speedup?

Extract from test_Loading on the N900:
        benchmark: http://cs.nyu.edu/courses/fall02/V22.0201-001/nasm_doc_html/nasmdocb.html
                mean:     1043 msecs +/- 4 msecs, +/- 0,383509 %
                avg:      1042 msecs
                        1050, 1045, 1038, 1040, 1039, 1043, 1046, 1042, 1036
        benchmark: http://cs.nyu.edu/courses/fall02/V22.0201-001/nasm_doc_html/nasmdocb.html
                mean:     1030 msecs +/- 3 msecs, +/- 0,291262 %
                avg:      1030 msecs
                        1035, 1036, 1025, 1026, 1030, 1032, 1032, 1026, 1029

Given the variance, it is a &lt;1% improvement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193642</commentid>
    <comment_count>12</comment_count>
      <attachid>49379</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-02-24 22:56:43 -0800</bug_when>
    <thetext>Comment on attachment 49379
Same patch with fleshed-out ChangeLog

Clearing flags on attachment: 49379

Committed r55224: &lt;http://trac.webkit.org/changeset/55224&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>193643</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-02-24 22:56:48 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>49373</attachid>
            <date>2010-02-24 03:20:45 -0800</date>
            <delta_ts>2010-02-24 05:11:00 -0800</delta_ts>
            <desc>Proposed patch</desc>
            <filename>bug-35336.diff</filename>
            <type>text/plain</type>
            <size>1271</size>
            <attacher name="Andreas Kling">kling</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
MmMzOTc5YS4uOTFkYzNjOSAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNCBAQAorMjAxMC0wMi0yNCAgQW5kcmVhcyBLbGlu
ZyAgPGFuZHJlYXMua2xpbmdAbm9raWEuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIE9wdGltaXplIEZvbnQ6Om5vcm1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ENoYXJhY3RlciA9IHN0cmluZ1tpXTsK
KyAgICAgICAgVUNoYXIgb3JpZ2luYWxDaGFyYWN0ZXIgPSBjaGFyYWN0ZXJzW2ldOwogICAgICAg
ICBidWZmZXJbaV0gPSBub3JtYWxpemVTcGFjZXMob3JpZ2luYWxDaGFyYWN0ZXIpOwogICAgICAg
ICBpZiAoYnVmZmVyW2ldICE9IG9yaWdpbmFsQ2hhcmFjdGVyKQogICAgICAgICAgICAgZGlkUmVw
bGFjZW1lbnQgPSB0cnVlOwo=
</data>
<flag name="review"
          id="32223"
          type_id="1"
          status="-"
          setter="kenneth"
    />
          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>49379</attachid>
            <date>2010-02-24 05:11:00 -0800</date>
            <delta_ts>2010-02-24 22:56:43 -0800</delta_ts>
            <desc>Same patch with fleshed-out ChangeLog</desc>
            <filename>bug-35336-2.diff</filename>
            <type>text/plain</type>
            <size>1361</size>
            <attacher name="Andreas Kling">kling</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
YTRlMzgyYi4uY2NlODZhNyAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNSBAQAorMjAxMC0wMi0yNCAgQW5kcmVhcyBLbGlu
ZyAgPGFuZHJlYXMua2xpbmdAbm9raWEuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIE9wdGltaXplZCBGb250Ojpub3JtYWxpemVTcGFjZXMoKSBi
eSBjYWNoaW5nIHRoZSBTdHJpbmc6OmNoYXJhY3RlcnMoKQorICAgICAgICBpbnN0ZWFkIG9mIHJl
cGVhdGVkbHkgY2FsbGluZyBvcGVyYXRvcltdCisKKyAgICAg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