<!--
RSS generated by JIRA (4.4#649-r158309) at Wed Jun 19 00:49:35 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+10020+AND+labels+%3D+performance&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://dev.clojure.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Clojure JIRA</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+10020+AND+labels+%3D+performance</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="1" total="1"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<item>
            <title>[LOGIC-50] Rel relation PersistentHashSet becomes LazySeq after issuing a retraction</title>
                <link>http://dev.clojure.org/jira/browse/LOGIC-50</link>
                <project id="10020" key="LOGIC">core.logic</project>
                        <description>&lt;p&gt;The first retraction of facts from a relation transforms the internal PersistentHashSet -set var+atom, which guarantees uniqueness, into a LazySeq which allows duplicate facts to be added. Once the first retraction occurs, a LazySeq persists for the rest of the life of the relation. Only the value of the primary -set var+atom is affected, not the -index var+atom values.&lt;/p&gt;

&lt;p&gt;This issue is not an external correctness issue but does affect performance of subsequent duplicate fact additions which grow the size relation.&lt;/p&gt;

&lt;p&gt;Preparation:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;user=&amp;gt; (defrel foo x y)
#&amp;lt;user$eval4287$fn__4288 user$eval4287$fn__4288@1a9d489b&amp;gt;
user=&amp;gt; (facts foo [[:joe :man][:jane :woman][:sue :boy]])
nil
user=&amp;gt; foo_2-set
#&amp;lt;Atom@52aaf223: #{[:joe :man] [:jane :woman] [:sue :boy]}&amp;gt;
user=&amp;gt; (class @foo_2-set)
clojure.lang.PersistentHashSet
user=&amp;gt; (retraction foo :jane :woman)
nil&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without patch applied:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;user=&amp;gt; foo_2-set
#&amp;lt;Atom@52aaf223: ([:joe :man] [:sue :boy])&amp;gt;
user=&amp;gt; (class @foo_2-set)
clojure.lang.LazySeq
user=&amp;gt; (facts foo [[:joe :man][:jane :woman][:sue :boy]])
nil
user=&amp;gt; foo_2-set
#&amp;lt;Atom@52aaf223: ([:sue :boy] [:jane :woman] [:joe :man] [:joe :man] [:sue :boy])&amp;gt;
user=&amp;gt; (class @foo_2-set)
clojure.lang.LazySeq&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;With patch applied:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;user=&amp;gt; foo_2-set
#&amp;lt;Atom@31eb9b15: #{[:joe :man] [:sue :boy]}&amp;gt;
user=&amp;gt; (class @foo_2-set)
clojure.lang.PersistentHashSet
user=&amp;gt; (facts foo [[:joe :man][:jane :woman][:sue :boy]])
nil
user=&amp;gt; foo_2-set
#&amp;lt;Atom@31eb9b15: #{[:joe :man] [:jane :woman] [:sue :boy]}&amp;gt;
user=&amp;gt; (class @foo_2-set)
clojure.lang.PersistentHashSet&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;ve filed this as a Minor issue as it does not affect core.logic correctness and degraded performance can be avoided by not re-asserting duplicate facts.&lt;/p&gt;

&lt;p&gt;I will also issue a GitHub pull request which can be used or ignored at your convenience.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15666">LOGIC-50</key>
            <summary>Rel relation PersistentHashSet becomes LazySeq after issuing a retraction</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="dnolen">David Nolen</assignee>
                                <reporter username="abrooks">Aaron Brooks</reporter>
                        <labels>
                        <label>performance</label>
                    </labels>
                <created>Sat, 1 Sep 2012 20:15:44 -0500</created>
                <updated>Wed, 5 Sep 2012 11:32:52 -0500</updated>
                    <resolved>Wed, 5 Sep 2012 11:32:52 -0500</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>1</watches>
                        <comments>
                    <comment id="29337" author="dnolen" created="Sun, 2 Sep 2012 17:45:26 -0500"  >&lt;p&gt;Thanks! Is this meant to be applied to master?&lt;/p&gt;</comment>
                    <comment id="29351" author="abrooks" created="Mon, 3 Sep 2012 18:56:08 -0500"  >&lt;p&gt;(cf. here and &lt;a href=&quot;https://github.com/clojure/core.logic/pull/9#issuecomment-8243216&quot;&gt;GitHub&lt;/a&gt; I&apos;ll keep this thread on JIRA.) Yes, this is targeted for master. I don&apos;t know if this warrants a release unto itself.&lt;/p&gt;</comment>
                    <comment id="29353" author="abrooks" created="Tue, 4 Sep 2012 09:17:05 -0500"  >&lt;p&gt;I forgot to mention that I needed to add &quot;src/test/clojure&quot; to the project.clj :source-paths vector to get lein1/2&apos;s test command to run the tests. Is that expected? Is there another way to run the tests that I&apos;m missing? I&apos;m happy to file a separate ticket/patch to address this if project.clj needs to be modified.&lt;/p&gt;</comment>
                    <comment id="29354" author="dnolen" created="Tue, 4 Sep 2012 09:25:18 -0500"  >&lt;p&gt;Thanks for the information. Will apply to master. I actually run tests with &quot;mvn test&quot;, I&apos;ve updated :source-paths so other people can run the tests with lein.&lt;/p&gt;</comment>
                    <comment id="29355" author="dnolen" created="Tue, 4 Sep 2012 09:26:48 -0500"  >&lt;p&gt;I tried to apply the patch but I&apos;m getting a &quot;Patch format detection failed&quot;.&lt;/p&gt;</comment>
                    <comment id="29359" author="abrooks" created="Tue, 4 Sep 2012 16:16:15 -0500"  >&lt;p&gt;The attached patch should work fine with git-apply (in either &quot;cat foo.patch |git apply&quot; or &quot;git apply foo.patch&quot; form). I made the GitHub pull request as I figured that would be the easiest path to pull the changes in.&lt;/p&gt;</comment>
                    <comment id="29360" author="dnolen" created="Tue, 4 Sep 2012 18:04:12 -0500"  >&lt;p&gt;Yes the patch is not properly formatted and we&apos;re not supposed to take pull requests. The patch is missing attribution info. I normally apply patches with &quot;git am foo.patch&quot;. I used the following guide for figuring out how to generate patches that can be applied with &quot;git am&quot;, &lt;a href=&quot;http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git&quot;&gt;http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git&lt;/a&gt;.&lt;/p&gt;</comment>
                    <comment id="29377" author="abrooks" created="Wed, 5 Sep 2012 09:25:29 -0500"  >&lt;p&gt;My apologies for the extra run-around here. I&apos;ve attached an -002 version of the patch created with git-format-patch which should be amenable to git-am.&lt;/p&gt;</comment>
                    <comment id="29381" author="dnolen" created="Wed, 5 Sep 2012 11:32:52 -0500"  >&lt;p&gt;fixed, &lt;a href=&quot;http://github.com/clojure/core.logic/commit/9bc6eb42be28bfd2b493657344f6eea8f5ed657c&quot;&gt;http://github.com/clojure/core.logic/commit/9bc6eb42be28bfd2b493657344f6eea8f5ed657c&lt;/a&gt;. pushing out a 0.8.0-alpha3 release as well.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11470" name="core.logic-rel-001.patch" size="1113" author="abrooks" created="Sat, 1 Sep 2012 20:15:44 -0500" />
                    <attachment id="11479" name="core.logic-rel-002.patch" size="1157" author="abrooks" created="Wed, 5 Sep 2012 09:25:29 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>