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

changes in stream parsing #24

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

Conversation

mukrrmsson
Copy link

Instead of asking the socket each time, byte amount of a contract, quote, trade etc., we ask a certain buffer size (e.g. 4KB) and wait until socket delivers it. Upon reception, the whole byte buffer is parsed. I find this faster than the original method. However, there are some caveats:

  1. Socket will wait until there is enough data (i.e. buffer size), this can introduce delays into data delivery into callback if the buffer size is too high compared to expected delivered number of messages as the socket will wait.
  2. I noticed that on my Windows 11 machine, if buffer size is too small, sometimes ethernet crashes. Not sure if this is OS or device or Theta Terminal.
  3. Therefore a good balance needs to be found where we do not get throttled by OS and also dont get delayed due to longer waiting times at socket until buffer size is filled.

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