mirror of
https://github.com/speice-io/marketdata-shootout
synced 2024-11-23 16:38:22 -05:00
Bradlee Speice
369613843d
Cap'n Proto has a bug in deserialization; both in packed and unpacked, it gets to 43116 of 62253 messages.
35 lines
1.0 KiB
Rust
35 lines
1.0 KiB
Rust
extern crate capnpc;
|
|
|
|
use std::path::Path;
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
capnpc::CompilerCommand::new()
|
|
.src_prefix("")
|
|
.file("marketdata.capnp")
|
|
.output_path("src/")
|
|
.run()
|
|
.expect("Unable to compile capnpc");
|
|
|
|
flatc_rust::run(flatc_rust::Args {
|
|
inputs: &[Path::new("marketdata.fbs")],
|
|
out_dir: Path::new("src/"),
|
|
..Default::default()
|
|
})
|
|
.expect("Unable to compile flatc");
|
|
|
|
// There's no Rust-style builder crate for SBE,
|
|
// so we need to run the command by hand.
|
|
// TODO: Automatically download the SBE JAR?
|
|
let _output = Command::new("java")
|
|
.arg("-Dsbe.output.dir=src")
|
|
.arg("-Dsbe.xinclude.aware=true")
|
|
.arg("-Dsbe.target.language=uk.co.real_logic.sbe.generation.rust.Rust")
|
|
.arg("-Dsbe.target.namespace=marketdata_sbe")
|
|
.arg("-jar")
|
|
.arg("sbe-all-1.13.2-all.jar")
|
|
.arg("marketdata.xml")
|
|
.output()
|
|
.expect("Unable to execute SBE compiler");
|
|
}
|