<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>You could implement a custom bit set with internal loops that are apt to be unrolled by the jit.</span></div><div><br></div>  <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1">  <b><span style="font-weight:bold;">From:</span></b> Mark Proctor &lt;mproctor@codehaus.org&gt;<br> <b><span style="font-weight: bold;">To:</span></b> Rules Users List &lt;rules-users@lists.jboss.org&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, October 5, 2012 7:17 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rules-users] rule infinitely loops, appears to be depending on naming on variable<br> </font> </div> <br>
<div id="yiv1106994876"><div>There is a class called BitSet, which grows the number of bits.<div><div style="margin:0px;font-size:12px;">http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/BitSet.java</div><div style="margin:0px;font-size:12px;"><br></div><div style="margin:0px;font-size:12px;">This uses an array of longs instead. But i'm really reluctant to use this, because it adds overhead to our currently very lightweight operation, it has to create a for loop:</div><div style="margin:0px;font-size:12px;"><div class="yiv1106994876line" id="yiv1106994876line-644" style="padding-left: 10px; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: medium; background-color: rgb(255, 255, 255); "><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><span class="yiv1106994876kw" style="color:rgb(127, 0, 85);font-weight:bold;">public</span>&nbsp;<span class="yiv1106994876kw"
 style="color:rgb(127, 0, 85);font-weight:bold;">boolean</span>&nbsp;<a rel="nofollow" class="yiv1106994876context-menu" target="_blank" href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/BitSet.java#" style="padding:0px 0px 0px 4px;margin:0px;color:rgb(104, 144, 216);text-decoration:none;font-size:1.4em;"><img class="yiv1106994876img_base yiv1106994876img_jdt_elcl16_thin_show_toolbar" border="0" title="More ..." width="11" height="16" style="margin-left:3px;margin-right:3px;background-image:url(http://grepcode.com/static/app/images/common_sprite.png);background-position:0% -429px;background-repeat:no-repeat no-repeat;" id="yiv11069948763fd24be7-e9b7-436b-ab4a-f27249267edb" src="cid:1.936458715@web184801.mail.gq1.yahoo.com"></a><a rel="nofollow" style="padding:0px;margin:0px;" href="">intersects</a>(<a rel="nofollow" target="_blank"
 href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/BitSet.java#BitSet" title="java.util.BitSet" style="padding:0px;margin:0px;color:rgb(51, 102, 187);">BitSet</a>&nbsp;<span>set</span>)&nbsp;{</pre></div><div class="yiv1106994876line" id="yiv1106994876line-645" style="padding-left: 10px; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: medium; background-color: rgb(255, 255, 255); "><div class="yiv1106994876lnml" id="yiv1106994876lnml-645" style="display:inline;"><img width="16" height="16" id="yiv110699487679d579bd-3176-4c6d-9bad-775ab50e0aa2" src="cid:1.936458715@web184801.mail.gq1.yahoo.com"></div><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><span class="yiv1106994876kw" style="color:rgb(127, 0, 85);font-weight:bold;">for</span>&nbsp;(<span class="yiv1106994876kw" style="color:rgb(127, 0,
 85);font-weight:bold;">int</span>&nbsp;<span>i</span>&nbsp;=&nbsp;Math.<a rel="nofollow" target="_blank" href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/lang/Math.java#Math.min%28int%2Cint%29" title="java.lang.Math.min(int,int) : int" style="padding:0px;margin:0px;color:rgb(51, 102, 187);">min</a>(<span style="background-color:rgb(221, 221, 221);"><a rel="nofollow" target="_blank" href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/BitSet.java#BitSet.0wordsInUse" title="int wordsInUse" class="yiv1106994876hidden" style="padding:0px;margin:0px;color:rgb(0, 0, 0);text-decoration:none;">wordsInUse</a></span>,&nbsp;<span>set</span>.<span style="background-color:rgb(221, 221, 221);">wordsInUse</span>)&nbsp;-&nbsp;1;&nbsp;<span>i</span>&nbsp;&gt;=&nbsp;0;&nbsp;<span>i</span>--) {</pre></div><div class="yiv1106994876line" id="yiv1106994876line-646" style="padding-left: 10px;
 font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: medium; background-color: rgb(255, 255, 255); "><div class="yiv1106994876lnml" id="yiv1106994876lnml-646" style="display:inline;"><img width="16" height="16" id="yiv11069948761d56e806-c230-4587-a91c-477ab2e01709" src="cid:1.936458715@web184801.mail.gq1.yahoo.com">&nbsp; &nbsp;&nbsp;</div><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><span class="yiv1106994876kw" style="color:rgb(127, 0, 85);font-weight:bold;">if</span>&nbsp;((<span><a rel="nofollow" target="_blank" href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/BitSet.java#BitSet.0words" title="long[] words" class="yiv1106994876hidden" style="padding:0px;margin:0px;color:rgb(0, 0, 0);text-decoration:none;">words</a></span>[<span>i</span>]&nbsp;&amp;&nbsp;<span>set</span>.<span>words</span>[<span>i</span>])&nbsp;!=&nbsp;0) {</pre></div><div
 class="yiv1106994876line" id="yiv1106994876line-647" style="padding-left:10px;font-size:medium;background-color:rgb(255, 255, 255);"><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><span class="yiv1106994876kw" style="white-space:normal;"><font face="Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif"></font></span><span class="yiv1106994876kw" style="font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; color: rgb(127, 0, 85); font-weight: bold; ">            return</span><font face="Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif">&nbsp;</font><span class="yiv1106994876kw" style="font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; color: rgb(127, 0, 85); font-weight: bold; ">true</span><font face="Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif">;</font></pre></div><div class="yiv1106994876line" id="yiv1106994876line-647"
 style="padding-left:10px;font-size:medium;background-color:rgb(255, 255, 255);"><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><font face="Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif">         }</font></pre></div><div class="yiv1106994876line" id="yiv1106994876line-647" style="padding-left:10px;font-size:medium;background-color:rgb(255, 255, 255);"><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><font face="Lucida Grande, Tahoma, Verdana, Arial, Helvetica, sans-serif">     }</font></pre></div><div class="yiv1106994876line" id="yiv1106994876line-648" style="padding-left: 10px; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: medium; background-color: rgb(255, 255, 255); "><div class="yiv1106994876lnml" id="yiv1106994876lnml-648" style="display:inline;"><img width="16" height="16" id="yiv11069948761a936c84-e3a4-4b9d-9cb2-d5bda24d6bf2"
 src="cid:1.936458715@web184801.mail.gq1.yahoo.com">&nbsp;</div><pre style="margin-top:0px;margin-bottom:0px;display:inline;"><span class="yiv1106994876kw" style="color:rgb(127, 0, 85);font-weight:bold;">return</span>&nbsp;<span class="yiv1106994876kw" style="color:rgb(127, 0, 85);font-weight:bold;">false</span>;</pre></div><div class="yiv1106994876line" id="yiv1106994876line-649" style="padding-left: 10px; font-family: 'Lucida Grande', Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: medium; background-color: rgb(255, 255, 255); "><pre style="margin-top:0px;margin-bottom:0px;display:inline;">}<br></pre></div><div><br></div></div><div style="margin:0px;font-size:12px;">But we can investigate and see if it adds any noticeable performance. In the meantime the kbuilder should probably throw an exception.</div><div style="margin:0px;font-size:12px;"><br></div><div style="margin:0px;font-size:12px;">Mark</div><div
 style="margin:0px;font-size:12px;"><br></div><div><div>On 5 Oct 2012, at 21:44, Davide Sottara &lt;<a rel="nofollow" ymailto="mailto:dsotty@gmail.com" target="_blank" href="mailto:dsotty@gmail.com">dsotty@gmail.com</a>&gt; wrote:</div><br class="yiv1106994876Apple-interchange-newline"><blockquote type="cite">At the moment, @propertyReactive uses a bit mask internally... and I believe<br>that is limited to 64 bits, which corresponds to 64 fields, less than what<br>you have. <br>I'm not 100% sure since I didn't check, but I have the feeling that it may<br>explain what is going on here..<br>You have something like 160 fields, which is 128+32.. adding or removing one<br>might indeed make a difference!<br><br>This may indeed be a (known?) bug or limitation of the current impl, Mario<br>Fusco will be able to provide more insight..<br><br>You can easily work around the problem, at least for now, by preventing the<br>loop with
 updatedArBankruptcyChapterPopulated != "No"<br><br>A side question would be: do you really need all those fields in the same<br>class? Wouldn't it be more reasonable to split it them in multiple beans,<br>rather than a single generic "Facts" class? I'm not familiar<br>with the domain, but the properties seem very hetherogeneous...<br>Also in terms of efficiency and memory consumption, would an average<br>instance of yours have most of those fields populated?<br><br>Best<br>Davide<br><br><br><br>--<br>View this message in context: http://drools.46999.n3.nabble.com/rule-infinitely-loops-appears-to-be-depending-on-naming-on-variable-tp4020158p4020159.html<br>Sent from the Drools: User forum mailing list archive at <a rel="nofollow" target="_blank" href="http://nabble.com/">Nabble.com</a>.<br>_______________________________________________<br>rules-users mailing list<br><a rel="nofollow" ymailto="mailto:rules-users@lists.jboss.org" target="_blank"
 href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/rules-users<br></blockquote></div><br></div></div></div><br>_______________________________________________<br>rules-users mailing list<br><a ymailto="mailto:rules-users@lists.jboss.org" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br><br><br> </div> </div>  </div></body></html>