I was doing some profiling in JVisualVM for fun when I noticed that the
isSatisfied method in EcState.java was topping the charts in terms of CPU
usage. It seems to be most noticeable when only final information is given (no
waypoints). Not a major problem, but I felt like playing around with it anyway
:)
After a bit of tweaking, I found I was able to get a ~5% decrease in CPU time
by moving the waypoints loop to the end of the method and switching the ands
from bitwise to short-circuit evaluating. I guess I could have factored the if
statements into a single return, but I thought that would damage readability.
Attached is a patch with the changes I made so others can test them out. I
tested it as best I could for any logical errors, and there seemed to be no
change in functionality. But of course since I'm not the primary programmer I
may have missed something.
Keep up the good work all!
Cheers,
Derek Guenther
Original issue reported on code.google.com by spacepir...@gmail.com on 25 Oct 2010 at 1:45
Original issue reported on code.google.com by
spacepir...@gmail.com
on 25 Oct 2010 at 1:45Attachments: