You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Martin Lichtin <li...@yahoo.com.INVALID> on 2016/04/09 19:51:42 UTC

Performance issue in FilePendingMessageCursor.isEmpty()

With a test sending 5000 messages to a queue, I see heavy CPU use on the broker side (v 5.12.2).
Using Yourkit it shows that the hot spot methods are



FilePendingMessageCursor.isEmpty() iterates over in-memory messages and therefore (as it is a prioritized queue) uses PrioritizedPendingListIterator which uses OrderedPendingList.getAsList() which turns out to be an expensive method as it converts the self-managed linked list to a Java ArrayList.

I wonder if anyone else has seen this issue?

Perhaps PrioritizedPendingListIterator could be improved to walk the priority lists via OrderedPendingList iterators, as these are implemented efficiently.

- Martin




Re: Re: Performance issue in FilePendingMessageCursor.isEmpty()

Posted by Martin Lichtin <li...@yahoo.com.INVALID>.
Ok, I submitted a JIRA https://issues.apache.org/jira/browse/AMQ-6239

On 10.04.2016 06:11, Tim Bain wrote:
> Looks like your attachment from YourKit was stripped off.
>
> But your suggestion seems like a reasonable improvement; submit a JIRA
> enhancement request.  Even better, a patch or a pull request!
> On Apr 9, 2016 11:51 AM, "Martin Lichtin" <li...@yahoo.com.invalid> wrote:
>
> With a test sending 5000 messages to a queue, I see heavy CPU use on the
> broker side (v 5.12.2).
> Using Yourkit it shows that the hot spot methods are
>
>
>
> FilePendingMessageCursor.isEmpty() iterates over in-memory messages and
> therefore (as it is a prioritized queue) uses
> PrioritizedPendingListIterator which uses OrderedPendingList.getAsList()
> which turns out to be an expensive method as it converts the self-managed
> linked list to a Java ArrayList.
>
> I wonder if anyone else has seen this issue?
>
> Perhaps PrioritizedPendingListIterator could be improved to walk the
> priority lists via OrderedPendingList iterators, as these are implemented
> efficiently.
>
> - Martin
>


Re: Performance issue in FilePendingMessageCursor.isEmpty()

Posted by Tim Bain <tb...@alumni.duke.edu>.
Looks like your attachment from YourKit was stripped off.

But your suggestion seems like a reasonable improvement; submit a JIRA
enhancement request.  Even better, a patch or a pull request!
On Apr 9, 2016 11:51 AM, "Martin Lichtin" <li...@yahoo.com.invalid> wrote:

With a test sending 5000 messages to a queue, I see heavy CPU use on the
broker side (v 5.12.2).
Using Yourkit it shows that the hot spot methods are



FilePendingMessageCursor.isEmpty() iterates over in-memory messages and
therefore (as it is a prioritized queue) uses
PrioritizedPendingListIterator which uses OrderedPendingList.getAsList()
which turns out to be an expensive method as it converts the self-managed
linked list to a Java ArrayList.

I wonder if anyone else has seen this issue?

Perhaps PrioritizedPendingListIterator could be improved to walk the
priority lists via OrderedPendingList iterators, as these are implemented
efficiently.

- Martin