Giter Site home page Giter Site logo

Comments (4)

derMaaster avatar derMaaster commented on September 17, 2024 1

Hi @viktartse , apologies for getting back to you only now. That does in fact work. And thank you very much.

A note or just FYI - the .Clone function seems to be a relatively expensive operation in terms of memory, and somewhat in terms of memory and also latency to some degree. In the world of high frequency trading. (To my limited knowledge and expertise on those matters.)

from fix-antenna-net-core.

derMaaster avatar derMaaster commented on September 17, 2024

Definitely losing data integrity from before OnNewMessage() writes to a Channel and when a new thread reads from the Channel

from fix-antenna-net-core.

viktartse avatar viktartse commented on September 17, 2024

Hi @derMaaster, one thing that is definitely should be done if there is a need to process the received message later is cloning the message. The engine re-uses the same chunk of memory for every FixMessage that is passed to the OnNewMessage handler.
To clone the message you can do something like this:

var messageCopy = (FixMessage)message.Clone();

from fix-antenna-net-core.

Viktar-Tserashchuk avatar Viktar-Tserashchuk commented on September 17, 2024

I agree a call to .Clone is not very cheap but an alternative would be the engine constructing a new FixMessage object for every new message from scratch instead of reusing the same object. That would also have a cost.

from fix-antenna-net-core.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.