Skip to content
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

Update FIXMessageEncoder.java #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charlesbr1
Copy link
Contributor

Removed "Invalid FIX message object type : " error in encode(...) and support any message type, as the calling code is clean enough.

For each message sent, the previous version create garbages of size of the data to send multiplied by 2 (one bytes array and a direct ByteBuffer instance).
This version creates just one wrapped CharBuffer instance and reuses some thread allocated buffers.
It allocates 16 buffers of 8192 bytes by threads that is sending a message, more buffers are created on fly as before if needed, but only 16 will be kept in memory.

This pull request was resubmitted to take into account remarks from Chris (I was not able to update the previous one).

DEFAULT_BUFFER_SIZE parameters and may be MAX_BUFFERS_BY_THREAD still need to be put in external configuration. I'll did it at work, where I can easily tests the change is working.

Try to recycle some send buffer, and avoid allocations during string charset conversion
@chrjohn chrjohn mentioned this pull request May 23, 2016
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.

None yet

1 participant