No description
Find a file
2021-04-09 16:59:36 -07:00
.vscode move stream to tests 2021-04-05 02:14:23 +03:00
examples book fixed 2021-03-30 00:55:59 +03:00
spec pxm fix 2021-03-29 02:16:42 +03:00
src/newfix move to streamfix 2021-04-06 00:11:13 +03:00
tests move to streamfix 2021-04-06 00:11:13 +03:00
.gitignore structure was changed 2021-03-29 01:42:31 +03:00
config.nims move stream to tests 2021-04-05 02:14:23 +03:00
newfix.nimble nimble 2021-03-30 00:39:18 +03:00
README.md Update README.md 2021-04-09 16:59:36 -07:00

Fix static-typed parser

The parser generates effective structure and its parser from QuickFix's specs XML files

The xml's are pregenerated into packages inside the newfix package

Usage

import newfix/fix44.nim  # For Full FIX44 specification, but better to optimize

let msg = "8=FIX4.4...." # Fix string
let fix = parseFix44(msg)
echo fix

Benchmarks

During the implementation, I was looking at the benchmark's numbers of CoralFIX Parser, which were mentioned like one of the fastest FIX parsers: http://www.coralblocks.com/index.php/coralfix-performance-numbers/ .

The article mentions hw: Intel i7 quad-core (4 x 3.50GHz) Ubuntu box overclocked to 4.50Ghz.

My hw: i5-7500 (4 x 3.40GHz) (not overclocked / win10)

Test CoralFIX NewFix StreamFix
Simple 481.55 ns 315.7449 ns 397.2781 ns
Repeating groups 1132 ns 581.9442 ns 502.9431 ns
Repeating groups inside repeating groups 1932 ns 1045.8 ns 820.1095 ns
MassQuote with 1x8 subgroups (314b) * 1570.5 ns 335.1315 ns
MassQuote with 5x6 subgroups (1010b) * 6616.0 ns 1312.4 ns
  • MassQuote: StreamFix extracts MsgType, QuoteID, Bid/OfferSize and BidOfferSpotPrice (to build a book)

StreamFix

https://github.com/inv2004/streamfix

Fix parser implementation without static garanties, but suitable to process streaming data from low-latency adapters without waiting for full message (not FPGA yet)

Optimization:

To optimize parsing speed it is better to remove unused fields from full specification like it have been done for ``spec/MINIMAL.xml' and PrimeXM specification in 'scpe/FIX44PXM.xml' already

$ nim c src/newfix/genfix.nim
$ src/newfix/genfix spec/FIX44MY.xml > fix44my.xml

Structure name from the top tags attributes: <fix type='FIX' major='4' minor='4' servicepack='min'> => Fix44Min

If you know that you can optimize some types: for example hex or int instead of string - it possible to optimize separate fields manually in the generated module.