Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.