Skip to content

Switching FrameType flags back to bits #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2018
Merged

Switching FrameType flags back to bits #548

merged 3 commits into from
Nov 13, 2018

Conversation

robertroeser
Copy link
Member

Switching FrameType flag back to bits. Current version uses an EnumSet which requires a contains method call. This method traverses and array, which requires you do this every time you created a Frame. This one does a bitmask and equals.

…n array when looking up flags

Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
@DisplayName(
"Rejecting setup by server causes requester RSocket disposal and RejectedSetupException")
@ParameterizedTest
@MethodSource(value = "transports")
@MethodSource(value = "transports")*/
Copy link
Member

@mostroverkhov mostroverkhov Nov 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing due to reactor-netty bug fixed by reactor/reactor-netty#462 in Californium-RELEASE. Before update It can be worked around with test { environment "java.net.preferIPv4Stack", "true"} in rsocket-transport-netty buildfile (works in some environments only)

FrameType(int encodedType) {
this(encodedType, EnumSet.noneOf(Flags.class));
this(encodedType, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this(encodedType, 0);
this(encodedType, Flags.EMPTY);

IS_REQUEST_TYPE;

private static class Flags {
private static final int CAN_HAVE_DATA = 0b10000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static final int CAN_HAVE_DATA = 0b10000;
private static final int EMPTY = 0b00000;
private static final int CAN_HAVE_DATA = 0b10000;

Signed-off-by: Robert Roeser <rroeserr@gmail.com>
@robertroeser robertroeser merged commit fc5d257 into 1.0.x Nov 13, 2018
robertroeser added a commit to robertroeser/rsocket-java that referenced this pull request Nov 20, 2018
* switching frame type flag back to bits so we don't have to traverse an array when looking up flags

Signed-off-by: Robert Roeser <rroeserr@gmail.com>

* jmh test

Signed-off-by: Robert Roeser <rroeserr@gmail.com>

* Added an EMPTY flag

Signed-off-by: Robert Roeser <rroeserr@gmail.com>
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
robertroeser added a commit that referenced this pull request Nov 22, 2018
* reset to snapshots for next release

* Switching FrameType flags back to bits (#548)

* switching frame type flag back to bits so we don't have to traverse an array when looking up flags

* jmh test


* Added an EMPTY flag


* changes from performance testing for Netty transport, and underlying RSocket core protocol


* removing unused imports



* switched to netty's IntObjectMap

Signed-off-by: Robert Roeser <rroeserr@gmail.com>
@robertroeser robertroeser deleted the frameType branch February 28, 2019 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants