[jboss-jira] [JBoss JIRA] Commented: (JBRULES-3141) Replace BinaryHeapPriorityQueue Implementation with Java's PriorityBlockingQueue

Brad Davis (JIRA) jira-events at lists.jboss.org
Thu Jul 14 14:30:23 EDT 2011


    [ https://issues.jboss.org/browse/JBRULES-3141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12614260#comment-12614260 ] 

Brad Davis commented on JBRULES-3141:
-------------------------------------

Removal and search over the heap is slow with the Java implementation.  We will need to figure out a way around this for self removal.

I will add tests for search and self removal, and will extend the BasePriorityQueue to support faster self removal.

> Replace BinaryHeapPriorityQueue Implementation with Java's PriorityBlockingQueue
> --------------------------------------------------------------------------------
>
>                 Key: JBRULES-3141
>                 URL: https://issues.jboss.org/browse/JBRULES-3141
>             Project: Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>            Reporter: Brad Davis
>            Assignee: Mark Proctor
>         Attachments: BasePriorityQueue.java, BinaryHeapPriorityQueueTest.java
>
>
> Attached is a PriorityQueue implementation I wrote last night to replace our home grown implementation.  I think it must have preceded the PriorityBlockingQueue that is already part of Java 5 & 6.
> BinaryHeapPriorityQueueTest is where I plugged in this implementation.  Below are the results first running with our home grown BinaryHeapPriorityQueue, and then with the one I created, BasePriorityQueue.  There are numerous other benefits to using this as well, as it will fully implement the java.util.Collections API and therefore cleanup some other code elsewhere in our codebase.
> The result for 10000 objects inserted and retracted was: 
> BinaryHeapPriortyQueue
> elapsedEnqueue = 32
> elapsedDequeue = 294
> BasePriorityQueue
> elapsedEnqueue = 26
> elapsedDequeue = 167

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list