You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by "Tsz-wo Sze (Jira)" <ji...@apache.org> on 2019/11/19 17:31:00 UTC
[jira] [Assigned] (RATIS-749) Create constant for set of not
running states
[ https://issues.apache.org/jira/browse/RATIS-749?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tsz-wo Sze reassigned RATIS-749:
--------------------------------
Assignee: Attila Doroszlai
> Create constant for set of not running states
> ---------------------------------------------
>
> Key: RATIS-749
> URL: https://issues.apache.org/jira/browse/RATIS-749
> Project: Ratis
> Issue Type: Improvement
> Components: server
> Reporter: Attila Doroszlai
> Assignee: Attila Doroszlai
> Priority: Minor
> Labels: performance
> Attachments: RATIS-749.001.patch, RATIS-749.001b.patch, RATIS-749.002.patch, RATIS-749.002b.patch, allocations.png
>
>
> {{LogAppender$AppenderDaemon#isRunning}} creates a new array for varargs of {{LifeCycle$State#isOneOf}} upon each call:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L98-L100}
> boolean isRunning() {
> return !lifeCycle.getCurrentState().isOneOf(CLOSING, CLOSED, EXCEPTION);
> }
> {code}
> This is frequently called (indirectly) from the main loop:
> {code:title=https://github.com/apache/incubator-ratis/blob/005aa6ab0f7a9051bb4c4a47660bca29ec70aa20/ratis-server/src/main/java/org/apache/ratis/server/impl/LogAppender.java#L450-L451}
> protected void runAppenderImpl() throws InterruptedException, IOException {
> while (isAppenderRunning()) {
> {code}
> There should be a constant array defined with these states to reduce GC.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)