[jira] [Updated] (CASSANDRA-12343) Make 'static final boolean' easier to optimize for Hotspot
[ https://issues.apache.org/jira/browse/CASSANDRA-12343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Stupp updated CASSANDRA-12343: - Resolution: Fixed Fix Version/s: (was: 3.x) 3.10 Status: Resolved (was: Ready to Commit) > Make 'static final boolean' easier to optimize for Hotspot > -- > > Key: CASSANDRA-12343 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12343 > Project: Cassandra > Issue Type: Improvement >Reporter: Robert Stupp >Assignee: Robert Stupp >Priority: Trivial > Fix For: 3.10 > > > Hotspot is able to optimize condition checks on `static final` fields. But > the compiler can only optimize if the referenced "constant" is the first > condition to check. (If I understood the optimization in Hotspot correctly.) > I.e. the first {{if}} block can be "eliminated" whereas the second cannot: > {code} > class Foo { > static final boolean CONST = /* some fragment evaluating to false */; > > public void doSomeStuff(boolean param) { > if (!CONST) { > // this code block can be eliminated > } > if (!CONST && param) { > // this code block can be eliminated > } > if (param && !CONST) { > // this code block cannot be eliminated due to some compiler logic > } > > } > } > {code} > Linked patch changes the order in some {{if}} statements and migrates a few > methods to static final fields. > ||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...snazy:boolean-hotspot]|[testall|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-testall/lastSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-dtest/lastSuccessfulBuild/] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (CASSANDRA-12343) Make 'static final boolean' easier to optimize for Hotspot
[ https://issues.apache.org/jira/browse/CASSANDRA-12343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Branimir Lambov updated CASSANDRA-12343: Status: Ready to Commit (was: Patch Available) > Make 'static final boolean' easier to optimize for Hotspot > -- > > Key: CASSANDRA-12343 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12343 > Project: Cassandra > Issue Type: Improvement >Reporter: Robert Stupp >Assignee: Robert Stupp >Priority: Trivial > Fix For: 3.x > > > Hotspot is able to optimize condition checks on `static final` fields. But > the compiler can only optimize if the referenced "constant" is the first > condition to check. (If I understood the optimization in Hotspot correctly.) > I.e. the first {{if}} block can be "eliminated" whereas the second cannot: > {code} > class Foo { > static final boolean CONST = /* some fragment evaluating to false */; > > public void doSomeStuff(boolean param) { > if (!CONST) { > // this code block can be eliminated > } > if (!CONST && param) { > // this code block can be eliminated > } > if (param && !CONST) { > // this code block cannot be eliminated due to some compiler logic > } > > } > } > {code} > Linked patch changes the order in some {{if}} statements and migrates a few > methods to static final fields. > ||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...snazy:boolean-hotspot]|[testall|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-testall/lastSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-dtest/lastSuccessfulBuild/] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (CASSANDRA-12343) Make 'static final boolean' easier to optimize for Hotspot
[ https://issues.apache.org/jira/browse/CASSANDRA-12343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joshua McKenzie updated CASSANDRA-12343: Reviewer: Branimir Lambov > Make 'static final boolean' easier to optimize for Hotspot > -- > > Key: CASSANDRA-12343 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12343 > Project: Cassandra > Issue Type: Improvement >Reporter: Robert Stupp >Assignee: Robert Stupp >Priority: Trivial > Fix For: 3.x > > > Hotspot is able to optimize condition checks on `static final` fields. But > the compiler can only optimize if the referenced "constant" is the first > condition to check. (If I understood the optimization in Hotspot correctly.) > I.e. the first {{if}} block can be "eliminated" whereas the second cannot: > {code} > class Foo { > static final boolean CONST = /* some fragment evaluating to false */; > > public void doSomeStuff(boolean param) { > if (!CONST) { > // this code block can be eliminated > } > if (!CONST && param) { > // this code block can be eliminated > } > if (param && !CONST) { > // this code block cannot be eliminated due to some compiler logic > } > > } > } > {code} > Linked patch changes the order in some {{if}} statements and migrates a few > methods to static final fields. > ||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...snazy:boolean-hotspot]|[testall|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-testall/lastSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-dtest/lastSuccessfulBuild/] -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (CASSANDRA-12343) Make 'static final boolean' easier to optimize for Hotspot
[ https://issues.apache.org/jira/browse/CASSANDRA-12343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Robert Stupp updated CASSANDRA-12343: - Status: Patch Available (was: Open) > Make 'static final boolean' easier to optimize for Hotspot > -- > > Key: CASSANDRA-12343 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12343 > Project: Cassandra > Issue Type: Improvement >Reporter: Robert Stupp >Assignee: Robert Stupp >Priority: Trivial > Fix For: 3.x > > > Hotspot is able to optimize condition checks on `static final` fields. But > the compiler can only optimize if the referenced "constant" is the first > condition to check. (If I understood the optimization in Hotspot correctly.) > I.e. the first {{if}} block can be "eliminated" whereas the second cannot: > {code} > class Foo { > static final boolean CONST = /* some fragment evaluating to false */; > > public void doSomeStuff(boolean param) { > if (!CONST) { > // this code block can be eliminated > } > if (!CONST && param) { > // this code block can be eliminated > } > if (param && !CONST) { > // this code block cannot be eliminated due to some compiler logic > } > > } > } > {code} > Linked patch changes the order in some {{if}} statements and migrates a few > methods to static final fields. > ||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...snazy:boolean-hotspot]|[testall|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-testall/lastSuccessfulBuild/]|[dtest|http://cassci.datastax.com/view/Dev/view/snazy/job/snazy-boolean-hotspot-dtest/lastSuccessfulBuild/] -- This message was sent by Atlassian JIRA (v6.3.4#6332)