[JBoss JIRA] (JGRP-2042) Improve performance of Message#writeHeader
by Bela Ban (JIRA)
[ https://issues.jboss.org/browse/JGRP-2042?page=com.atlassian.jira.plugin.... ]
Bela Ban edited comment on JGRP-2042 at 7/14/16 3:09 AM:
---------------------------------------------------------
Hmm, we could create an abstract method {{Header.getMagicId()}} which returns a constant magic ID. When {{ClassConfigurator}} is initialized, it would check that the magic IDs defined in {{jg-magic-map.xml}} actually match the ones returned by {{getMagicId()}}. In case of a mismatch, an exception would be thrown.
Downside: when IDs change, the corresponding header classes have to be changed, too.
Upside: faster serialization (eliminating 1 hashmap lookup for the magic ID). We only have a limited number of header classes anyway.
was (Author: belaban):
Hmm, we could create an abstract method {{Header.getMagicId()}} which returns a constant magic ID. When {{ClassConfigurator}} is initialized, it would check that the magic IDs defined in {{jg-magic-map.xml}} actually match the ones returned by {{getId()}}. In case of a mismatch, an exception would be thrown.
Downside: when IDs change, the corresponding header classes have to be changed, too.
Upside: faster serialization (eliminating 1 hashmap lookup for the magic ID). We only have a limited number of header classes anyway.
> Improve performance of Message#writeHeader
> ------------------------------------------
>
> Key: JGRP-2042
> URL: https://issues.jboss.org/browse/JGRP-2042
> Project: JGroups
> Issue Type: Enhancement
> Reporter: Sanne Grinovero
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 3.6.11, 4.0
>
>
> The following stacktrace, taken with JFR, is highlighting a CPU consumer which could be optimised.
> {noformat}Stack Trace Sample Count Percentage(%)
> java.util.IdentityHashMap.get(Object) 66 2.224
> org.jgroups.conf.ClassConfigurator.getMagicNumber(Class) 66 2.224
> org.jgroups.Message.writeHeader(Header, DataOutput) 66 2.224
> {noformat}
> One idea could be to use an ad-hoc implementation of Map which takes advantage of the key being a {{Class}}. An interesting alternative would be to avoid the map lookup altogether, by having the Header expose a method like "writeMagicNumber(DataInput to)".
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (JGRP-2042) Improve performance of Message#writeHeader
by Bela Ban (JIRA)
[ https://issues.jboss.org/browse/JGRP-2042?page=com.atlassian.jira.plugin.... ]
Bela Ban edited comment on JGRP-2042 at 7/14/16 3:08 AM:
---------------------------------------------------------
Hmm, we could create an abstract method {{Header.getMagicId()}} which returns a constant magic ID. When {{ClassConfigurator}} is initialized, it would check that the magic IDs defined in {{jg-magic-map.xml}} actually match the ones returned by {{getId()}}. In case of a mismatch, an exception would be thrown.
Downside: when IDs change, the corresponding header classes have to be changed, too.
Upside: faster serialization (eliminating 1 hashmap lookup for the magic ID). We only have a limited number of header classes anyway.
was (Author: belaban):
Hmm, we could create an abstract method {{Header.getId()}} which returns a constant magic ID. When {{ClassConfigurator}} is initialized, it would check that the magic IDs defined in {{jg-magic-map.xml}} actually match the ones returned by {{getId()}}. In case of a mismatch, an exception would be thrown.
Downside: when IDs change, the corresponding header classes have to be changed, too.
Upside: faster serialization (eliminating 1 hashmap lookup for the magic ID). We only have a limited number of header classes anyway.
> Improve performance of Message#writeHeader
> ------------------------------------------
>
> Key: JGRP-2042
> URL: https://issues.jboss.org/browse/JGRP-2042
> Project: JGroups
> Issue Type: Enhancement
> Reporter: Sanne Grinovero
> Assignee: Bela Ban
> Priority: Minor
> Fix For: 3.6.11, 4.0
>
>
> The following stacktrace, taken with JFR, is highlighting a CPU consumer which could be optimised.
> {noformat}Stack Trace Sample Count Percentage(%)
> java.util.IdentityHashMap.get(Object) 66 2.224
> org.jgroups.conf.ClassConfigurator.getMagicNumber(Class) 66 2.224
> org.jgroups.Message.writeHeader(Header, DataOutput) 66 2.224
> {noformat}
> One idea could be to use an ad-hoc implementation of Map which takes advantage of the key being a {{Class}}. An interesting alternative would be to avoid the map lookup altogether, by having the Header expose a method like "writeMagicNumber(DataInput to)".
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (WFLY-6782) Unable to add JGroups protocol at a given index via CLI
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/WFLY-6782?page=com.atlassian.jira.plugin.... ]
Ladislav Thon edited comment on WFLY-6782 at 7/14/16 2:14 AM:
--------------------------------------------------------------
This is very nice, thanks! What would be even better IMHO is an ability to add a protocol into the stack _before_ or _after_ a given protocol. Something like {{/subsystem=jgroups/stack=udp/protocol=XXX:add(before-protocol=pbcast.GMS)}}. With {{add-index}}, I first have to compute the correct index, which is unfriendly, error-prone and can change in time.
EDIT: I see that this is only one of multiple JIRAs that cover this functionality. If you think I should add the comment to a different JIRA or open a whole new JIRA, I'd gladly do so.
was (Author: lthon):
This is very nice, thanks! What would be even better IMHO is an ability to add a protocol into the stack _before_ or _after_ a given protocol. Something like {{/subsystem=jgroups/stack=udp/protocol=XXX:add(before-protocol=pbcast.GMS)}}. With {{add-index}}, I first have to compute the correct index, which is unfriendly, error-prone and can change in time.
> Unable to add JGroups protocol at a given index via CLI
> -------------------------------------------------------
>
> Key: WFLY-6782
> URL: https://issues.jboss.org/browse/WFLY-6782
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 8.2.1.Final, 9.0.2.Final, 10.0.0.Final
> Reporter: Radoslav Husar
> Assignee: Radoslav Husar
> Fix For: 10.1.0.Final
>
>
> Unable to use this via CLI, tests pass since they use management client which won't check against the operation description:
> {noformat}
> [standalone@localhost:9990 /] /subsystem=jgroups/stack=tcp/protocol=JDBC_PING:add(add-index=4)
> 'add-index' is not found among the supported properties: [socket-binding, module, properties, type]
> {noformat}
> add index is missing in the description, after the fix:
> {noformat}
> [standalone@localhost:9990 /] /subsystem=jgroups/stack=tcp/protocol=MPING:read-operation-description(name=add
> {
> "outcome" => "success",
> "result" => {
> "operation-name" => "add",
> "description" => "Add a protocol to a protocol stack.",
> "request-properties" => {
> "add-index" => {
> "type" => INT,
> "description" => "If specified inserts the protocol at the given (zero-based) index. If null it will add at the end.",
> "expressions-allowed" => false,
> "required" => false,
> "nillable" => true
> },
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months
[JBoss JIRA] (WFLY-6782) Unable to add JGroups protocol at a given index via CLI
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/WFLY-6782?page=com.atlassian.jira.plugin.... ]
Ladislav Thon commented on WFLY-6782:
-------------------------------------
This is very nice, thanks! What would be even better IMHO is an ability to add a protocol into the stack _before_ or _after_ a given protocol. Something like {{/subsystem=jgroups/stack=udp/protocol=XXX:add(before-protocol=pbcast.GMS)}}. With {{add-index}}, I first have to compute the correct index, which is unfriendly, error-prone and can change in time.
> Unable to add JGroups protocol at a given index via CLI
> -------------------------------------------------------
>
> Key: WFLY-6782
> URL: https://issues.jboss.org/browse/WFLY-6782
> Project: WildFly
> Issue Type: Bug
> Components: Clustering
> Affects Versions: 8.2.1.Final, 9.0.2.Final, 10.0.0.Final
> Reporter: Radoslav Husar
> Assignee: Radoslav Husar
> Fix For: 10.1.0.Final
>
>
> Unable to use this via CLI, tests pass since they use management client which won't check against the operation description:
> {noformat}
> [standalone@localhost:9990 /] /subsystem=jgroups/stack=tcp/protocol=JDBC_PING:add(add-index=4)
> 'add-index' is not found among the supported properties: [socket-binding, module, properties, type]
> {noformat}
> add index is missing in the description, after the fix:
> {noformat}
> [standalone@localhost:9990 /] /subsystem=jgroups/stack=tcp/protocol=MPING:read-operation-description(name=add
> {
> "outcome" => "success",
> "result" => {
> "operation-name" => "add",
> "description" => "Add a protocol to a protocol stack.",
> "request-properties" => {
> "add-index" => {
> "type" => INT,
> "description" => "If specified inserts the protocol at the given (zero-based) index. If null it will add at the end.",
> "expressions-allowed" => false,
> "required" => false,
> "nillable" => true
> },
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 6 months