On Tue, May 11, 2010 at 2:55 PM, djb <span dir="ltr"><<a href="mailto:dbrownell83@hotmail.com">dbrownell83@hotmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Hi Wolfgang,<br>
<br>
I use one thread per StatefulKnowledgeSession... My machine has 2 cores, but<br>
it will eventually be running on an 8 core beast, so i reckon this was a<br>
good improvement. I was just worried that I wouldn't be able to<br>
simultaneously process multiple K-Sessions, but apparently, Drools doesn't<br>
mind. I'm pretty sure any machine with multiple cores supports parallel<br>
java threads, no?<br>
<br></blockquote><div>This is a Q for a Java guru (which I'm not), and may depend on the JVM and what not. Care<br>to provide details? Probably there's people on this list who might know. (Otherwise,<br>I have a good contact.)<br>
<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----<br>
Regarding my Utilities method, eg. isWithinTimePeriod("20100308",<br>
"20090405", 1, "Y")<br>
<br>
I can get about 5ms off by commenting out the eval, so it's not going to be<br>
a big jump even if I fix it, but, well, I am using yyyyMMdd Strings, which<br>
in the method, I sub-stringed, converted to ints, instantiated DateMidnight<br>
objects, and compared using Joda-time daysBetween/monthsBetween/yearsBetween<br>
methods.<br>
<br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
My thought was that pre-converting to ints would help, so that each<br>
ClaimLine has year/month/day int variables, and pass them in instead. (i.e.,<br>
Saves 3 String.substring()'s, and 3 Integer.parseInt()). but that actually<br>
slowed it down a few milliseconds. (Maybe passing 6 params instead of 2?!) <br></blockquote><div><br>You can treat 20100510 as an integer defining one date; all relations between<br>such numbers would hold as for the "true" dates - you just can't compute<br>
durations (days between dates) by simple substraction.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm comparing two dates by an arbitrary period, like "2 days" or "1 month",<br>
and need the framework of the Gregorian Calendar. So, I don't think I can<br>
do anything about this. 2 months is never guaranteed to be a set number of<br>
milliseconds. It all depends on the claim date, which is fact data, and<br>
therefore variable.<br>
<br></blockquote><div><br>I'm not sure how the other arguments in the call ("Y", 99) are related to rules<br>or facts, but a repeated test whether one date dx is between d1 and d2 where<br>d2 depends on d1 and a duration would certainly gain from computing d2<br>
once. <br><br>-W<br><br></div></div><br>