[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GitHub] activemq pull request #300: AMQ-7055 - Optimization on SequenceSet to preven...

GitHub user alanprot opened a pull request:


    AMQ-7055 - Optimization on SequenceSet to prevent iterating through tâ?¦

    When the index file has a huge number of free pages and the broker is starting up (loading the index) we end up in a O(n2) loop.
    This was causing the broker to use 100% cpu and not being able to start up even after a long time (as i remember we had around 3 millions free page in this case)
    I noticed that almost all the free pages was being added to the end of the sequenceSet... So for any free page the broker had to necessity iterate through  all the Set (and after doing that for nothing add . the value to the tail).
    With this small change, the broker started up in less than 5 minutes.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alanprot/activemq feature/SequenceSetOptimization

Alternatively you can review and apply these changes as the patch at:


To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #300
commit 7377f7412597f5adea96d0802c050c86e86b5fa0
Author: Alan Protasio <alanprot@...>
Date:   2018-09-19T19:20:59Z

    AMQ-7055 - Optimization on SequenceSet to prevent iterating through the whole set when a value bigger than the last value is added