You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/10/18 18:46:00 UTC

[jira] [Work logged] (AMQ-7055) Small optimization on SequenceSet to prevent iterating through the whole set when a value bigger than the last value is added

     [ https://issues.apache.org/jira/browse/AMQ-7055?focusedWorklogId=330710&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-330710 ]

ASF GitHub Bot logged work on AMQ-7055:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Oct/19 18:45
            Start Date: 18/Oct/19 18:45
    Worklog Time Spent: 10m 
      Work Description: jbonofre commented on pull request #300: AMQ-7055 - Optimization on SequenceSet to prevent iterating through t…
URL: https://github.com/apache/activemq/pull/300
 
 
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 330710)
    Time Spent: 20m  (was: 10m)

> Small optimization on SequenceSet to prevent iterating through the whole set when a value bigger than the last value is added
> -----------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-7055
>                 URL: https://issues.apache.org/jira/browse/AMQ-7055
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: KahaDB
>    Affects Versions: 5.15.6
>            Reporter: Alan Protasio
>            Assignee: Gary Tully
>            Priority: Minor
>             Fix For: 5.16.0, 5.15.7
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> 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)
> [https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/page/PageFile.java#L428]
> https://github.com/apache/activemq/blob/master/activemq-kahadb-store/src/main/java/org/apache/activemq/store/kahadb/disk/util/SequenceSet.java#L118
> 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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)