[
https://issues.apache.org/jira/browse/ARTEMIS-3049?focusedWorklogId=531080&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-531080
]
ASF GitHub Bot logged work on ARTEMIS-3049:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 05/Jan/21 08:36
Start Date: 05/Jan/21 08:36
Worklog Time Spent: 10m
Work Description: franz1981 commented on a change in pull request #3393:
URL: https://github.com/apache/activemq-artemis/pull/3393#discussion_r551786170
##########
File path:
artemis-server/src/main/java/org/apache/activemq/artemis/core/paging/impl/PagingStoreImpl.java
##########
@@ -468,16 +468,11 @@ protected void reloadLivePage(int pageId) throws
Exception {
Page page = createPage(pageId);
page.open();
- List<PagedMessage> messages = page.read(storageManager);
+ final List<PagedMessage> messages = page.read(storageManager);
- LivePageCache pageCache = new LivePageCacheImpl(pageId);
+ final PagedMessage[] initialMessages = messages.toArray(new
PagedMessage[messages.size()]);
- for (PagedMessage msg : messages) {
- pageCache.addLiveMessage(msg);
- // As we add back to the live page,
- // we have to discount one when we read the page
- msg.getMessage().usageDown();
- }
+ final LivePageCache pageCache = new LivePageCacheImpl(pageId,
initialMessages);
Review comment:
@clebertsuconic
the original `addLiveMessage` was calling `usageUp` right before
`usageDown`: it means that they can both be saved as the ref count will remain
the same, correct?
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 531080)
Time Spent: 1.5h (was: 1h 20m)
> Reduce live page lookup cost
> ----------------------------
>
> Key: ARTEMIS-3049
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3049
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 2.16.0
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
> Priority: Major
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> LivePageCacheImpl::getMessage is performing a linked-list-like lookup that
> can be rather slow if compared to a O(1) lookup on ArrayList-like data
> structure.
> it's possible to speed it up by:
> # using a last accessed buffer cache on the append only chunked list used on
> LivePageCacheImpl, to speedup the most recent (& nearest) accesses
> # using an array with the fresh reloaded paged messages, in case of cache
> reload
> https://github.com/apache/activemq-artemis/pull/2494#issuecomment-455086939
> clearly show the issue with the current implementation.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)