quickfixj icon indicating copy to clipboard operation
quickfixj copied to clipboard

Update FIXMessageEncoder.java

Open charlesbr1 opened this issue 10 years ago • 0 comments

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.

charlesbr1 avatar Oct 24 '15 13:10 charlesbr1