<?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>38972</bug_id>
          
          <creation_ts>2010-05-11 22:32:14 -0700</creation_ts>
          <short_desc>Do not check if a database needs to be vacuumed after read-only transactions</short_desc>
          <delta_ts>2010-05-12 14:08:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</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="Dumitru Daniliuc">dumi</reporter>
          <assigned_to name="Dumitru Daniliuc">dumi</assigned_to>
          <cc>dglazkov</cc>
    
    <cc>ericu</cc>
    
    <cc>michaeln</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>224417</commentid>
    <comment_count>0</comment_count>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-05-11 22:32:14 -0700</bug_when>
    <thetext>Read-only transactions don&apos;t change the state of the database. Therefore, there&apos;s no point in checking if a database needs to be vacuumed after such a transaction.

Checking if a database needs to be vacuumed involves calling &apos;PRAGMA freelist_count&apos; and &apos;PRAGMA max_page_count&apos;, which adds an unnecessary overhead.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224424</commentid>
    <comment_count>1</comment_count>
      <attachid>55809</attachid>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-05-11 22:53:35 -0700</bug_when>
    <thetext>Created attachment 55809
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224648</commentid>
    <comment_count>2</comment_count>
      <attachid>55809</attachid>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2010-05-12 08:46:39 -0700</bug_when>
    <thetext>Comment on attachment 55809
patch

ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224763</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2010-05-12 11:39:18 -0700</bug_when>
    <thetext>Does this put a dent in the perf regression? Just checking.

Consider putting the call to vacuumIfNeeded() in the block that runs for transactions that actually mutated something to limit how often we do this function even further (ala, don&apos;t do it for &apos;write&apos; transactions that didn&apos;t really write anything).

    // The commit was successful, notify the delegates if the transaction modified this database
    if (m_modifiedDatabase) {
        m_database-&gt;incrementalVacuumIfNeeded();
        m_database-&gt;transactionClient()-&gt;didCommitTransaction(this);
    }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224857</commentid>
    <comment_count>4</comment_count>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-05-12 13:43:10 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; Does this put a dent in the perf regression? Just checking.
&gt; 
&gt; Consider putting the call to vacuumIfNeeded() in the block that runs for transactions that actually mutated something to limit how often we do this function even further (ala, don&apos;t do it for &apos;write&apos; transactions that didn&apos;t really write anything).
&gt; 
&gt;     // The commit was successful, notify the delegates if the transaction modified this database
&gt;     if (m_modifiedDatabase) {
&gt;         m_database-&gt;incrementalVacuumIfNeeded();
&gt;         m_database-&gt;transactionClient()-&gt;didCommitTransaction(this);
&gt;     }

done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>224876</commentid>
    <comment_count>5</comment_count>
    <who name="Dumitru Daniliuc">dumi</who>
    <bug_when>2010-05-12 14:08:43 -0700</bug_when>
    <thetext>Landed as r59267.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>55809</attachid>
            <date>2010-05-11 22:53:35 -0700</date>
            <delta_ts>2010-05-12 08:46:38 -0700</delta_ts>
            <desc>patch</desc>
            <filename>patch</filename>
            <type>text/plain</type>
            <size>1421</size>
            <attacher name="Dumitru Daniliuc">dumi</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYkNvcmUvQ2hhbmdlTG9nCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYkNvcmUvQ2hhbmdlTG9n
CShyZXZpc2lvbiA1OTIwOSkKKysrIFdlYkNvcmUvQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBA
IC0xLDMgKzEsMTMgQEAKKzIwMTAtMDUtMTEgIER1bWl0cnUgRGFuaWxpdWMgIDxkdW1pQGNocm9t
aXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBEbyBub3QgY2hlY2sgaWYgYSBkYXRhYmFzZSBuZWVkcyB0byBiZSB2YWN1dW1lZCBhZnRlciBh
IHJlYWQtb25seSB0cmFuc2FjdGlvbi4KKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcv
c2hvd19idWcuY2dpP2lkPTM4OTcyCisKKyAgICAgICAgKiBzdG9yYWdlL1NRTFRyYW5zYWN0aW9u
LmNwcDoKKyAgICAgICAgKFdlYkNvcmU6OlNRTFRyYW5zYWN0aW9uOjpwb3N0ZmxpZ2h0QW5kQ29t
bWl0KToKKwogMjAxMC0wNS0xMSAgVG9ueSBDaGFuZyAgPHRvbnlAY2hyb21pdW0ub3JnPgogCiAg
ICAgICAgIFJldmlld2VkIGJ5IERhcmluIEZpc2hlci4KSW5kZXg6IFdlYkNvcmUvc3RvcmFnZS9T
UUxUcmFuc2FjdGlvbi5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViQ29yZS9zdG9yYWdlL1NRTFRyYW5z
YWN0aW9uLmNwcAkocmV2aXNpb24gNTkyMDQpCisrKyBXZWJDb3JlL3N0b3JhZ2UvU1FMVHJhbnNh
Y3Rpb24uY3BwCSh3b3JraW5nIGNvcHkpCkBAIC00NjYsOCArNDY2LDExIEBAIHZvaWQgU1FMVHJh
bnNhY3Rpb246OnBvc3RmbGlnaHRBbmRDb21taXQKICAgICAgICAgcmV0dXJuOwogICAgIH0KIAot
ICAgIC8vIFRoZSBjb21taXQgd2FzIHN1Y2Nlc3NmdWwsIHNvIHZhY3V1bSB0aGUgZGF0YWJhc2Ug
aWYgbmVlZGVkCi0gICAgbV9kYXRhYmFzZS0+aW5jcmVtZW50YWxWYWN1dW1JZk5lZWRlZCgpOwor
ICAgIC8vIFRoZSBjb21taXQgd2FzIHN1Y2Nlc3NmdWwsIHNvIHZhY3V1bSB0aGUgZGF0YWJhc2Ug
aWYgbmVlZGVkLgorICAgIC8vIFdlIGRvbid0IG5lZWQgdG8gZG8gYW55dGhpbmcgZm9yIHJlYWQt
b25seSB0cmFuc2FjdGlvbnMsCisgICAgLy8gYmVjYXVzZSB0aGV5IGNhbid0IGNoYW5nZSB0aGUg
c3RhdGUgb2YgdGhlIGRhdGFiYXNlLgorICAgIGlmICghbV9yZWFkT25seSkKKyAgICAgICAgbV9k
YXRhYmFzZS0+aW5jcmVtZW50YWxWYWN1dW1JZk5lZWRlZCgpOwogCiAgICAgLy8gVGhlIGNvbW1p
dCB3YXMgc3VjY2Vzc2Z1bCwgbm90aWZ5IHRoZSBkZWxlZ2F0ZXMgaWYgdGhlIHRyYW5zYWN0aW9u
IG1vZGlmaWVkIHRoaXMgZGF0YWJhc2UKICAgICBpZiAobV9tb2RpZmllZERhdGFiYXNlKQo=
</data>
<flag name="review"
          id="40085"
          type_id="1"
          status="+"
          setter="dglazkov"
    />
    <flag name="commit-queue"
          id="40086"
          type_id="3"
          status="-"
          setter="dumi"
    />
          </attachment>
      

    </bug>

</bugzilla>