Skip to content

Conversation

@ariksher-nex
Copy link
Contributor

varDataDisplay - use method getVarFieldName(Appendable) - no memory allocation. unlike calling method varFieldName where it allocates memory (new byte[] and new String).

…llocation. unlike calling method 'varFieldName' where it has new Byte and new String.
@ariksher-nex ariksher-nex changed the title Avoid memory allocation at varDataDisplay. [Java] Avoid memory allocation at varDataDisplay Oct 24, 2019
@mjpt777
Copy link
Contributor

mjpt777 commented Oct 24, 2019

This generates code which does not compile.

@ariksher-nex
Copy link
Contributor Author

ariksher-nex commented Oct 24, 2019

This generates code which does not compile.

yep, fixed it. apparently code is bit different for UTF and ASCII.

@mjpt777
Copy link
Contributor

mjpt777 commented Oct 24, 2019

The UTF-8 implementation allocates too. I'm not in favour of supporting this as it is too brittle.

@ariksher-nex
Copy link
Contributor Author

The UTF-8 implementation allocates too. I'm not in favour of supporting this as it is too brittle.

I'm using at my project ASCII chars and I'm willing to use the method appendTo that sits on the generated xxxDecoder class(es), which is very useful for logging incoming messages.

@mjpt777
Copy link
Contributor

mjpt777 commented Oct 24, 2019

I've pushed a more obvious changes which saves on allocation.

@ariksher-nex
Copy link
Contributor Author

I've pushed a more obvious changes which saves on allocation.

seen your commit and it paratially solves the problem see my comment there
391527a#r35648950

@mjpt777
Copy link
Contributor

mjpt777 commented Oct 24, 2019

A better approach for you to take is to use the append version if and only iff the encoding is ASCII otherwise output as is at present.

@mjpt777 mjpt777 merged commit c89c32c into aeron-io:master Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants