Giter VIP home page Giter VIP logo

transfix's Introduction

TransFIX

A Fix 4.2 Message Parser with Sub Millisecond Latency

TransFIX

Content

Overview

TransFix is a Fix4.2 version fast fix parser for parsing inbound fix messages. It can also be used by a OMS/EMS to send out FIX messages. This is a standard Fix4.2 implementation and at this time does not allow custom fix message configurations. Since TransFix is used in the eco-system of Chronicle, all message transactions can be persisted. TransFix uses a fast, off-heap object pool for Fix message sessions. This is useful when there is a need to read/send multiple FIX messages during transactions with multiple clients.

Object Construction

To download the JAR which contains TransFix package, we recommend you use maven, which will download it from Maven Central, once you have installed maven, all you have to do is add the following to your projects pom.xml :

<dependency>
  <groupId>net.openhft</groupId>
  <artifactId>fix-compiler</artifactId>
  <version><!--replace with the latest version--></version>
</dependency>

In order to create an instance of TransFix, its recommended to use the FixMessageBuilder

net.openhft.fix.include.v42;
...........

FixMessagePool fmp = new FIXMessageBuilder().initFixMessagePool(true, fixMsgCount);
FixMessageContainer<FixMessage> fmc = fmp.getFixMessageContainer();
FixMessage fm = fmc.getFixMessage();

For initFixMessagePool(boolean default, int fixMsgCount); method, if default variable is true, then FIXMessageBuilder loads pre-defined configuration as per FIX 4.2 version schema. Using default config, all FIX 4.2 protocol version fields are loaded for each FixMessage inside FixMessagePool. All FIX fields are accessibly by passing the exact field ID. For example, in order to set or get the message type (FIX 35=??), fm.getField(35).getFieldData() or fm.setField(35).setFieldData(6) for "Indication of interest". Each of the corresponding Field loaded in a FixMessage contains its own ByteBufferBytes data field of default size 1024 bytes. For multiple values, the data is separated by default delimiter "|" which is set to SOH (0x01) value while sent back on wire. Since the default config will load all of the described fields (1-436) for each FixMessage inside FixMessagePool, its recommended to custom load fields of necessity while constructing via FixMessageBuilder. This flexibility allows to control the size of FixMessage object.

Performance

TransFix supports java.lang.String or NativeBytes or ByteBufferBytes as input data to FixMessageBuilder. Its recommended to use NativeBytes for maximum performance even though all types work ok. The average NativeBytes message parsing time is 0.03us while for transmitting a FixMessage the average latency is about 1.5us.

Some latency numbers for parsing a sample Fix message "8=FIX.4.2|9=154|35=6|49=BRKR|56=INVMGR|34=238|52=19980604-07:59:56|23=115686|28=N|55=FIA.MI|54=2|27=250000|44=7900.000000|25=H|10=231|";
Average parse time was 0.13 us, fields per message 1.00, for 0.30m iterations
Average parse time was 0.05 us, fields per message 1.00, for 1.00m iterations
Average parse time was 0.02 us, fields per message 1.00, for 10.00m iterations
Average parse time was 0.01 us, fields per message 1.00, for 50.00m iterations


For reverse look up ( setting a single Fix message retrieved from pool and then iterating over it n times to calculate ByteBufferBytes based look up):
Average reverse-look-up time was 0.75 us, for 0.30m iterations
Average reverse-look-up time was 0.66 us, for 1.00m iterations
Average reverse-look-up time was 0.60 us, for 10.00m iterations
Average reverse-look-up time was 0.57 us, for 50.00m iterations

transfix's People

Contributors

ashelleyhft avatar peter-lawrey avatar derjust avatar hft-team-city avatar lburgazzoli avatar leventov avatar arosenberger avatar

Watchers

James Cloos avatar  avatar

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.