Skip to content

Commit baseline performance benchmark + profile code #9

@minicheddar

Description

@minicheddar

No attempt has been made to optimise the performance of the market data handlers.

We should commit some baseline benchmarks, and profile the code to see where the hot spots are.

There is some good guidance to Rust performance optimisation in the perf-book:
https://nnethercote.github.io/perf-book/introduction.html

serde_json deserialisation is likely the bottleneck here; but I'm also interested to understand the performance characteristics of tokio::spawn_blocking vs thread::spawn (as opposed to what we are currently doing with tokio::spawn)

We are also doing lots of unnecessary Arc<HashMap<Instrument, WebsocketSubscription>> lookups on each market data event to populate the MarketData.Instrument field.

As there are no immediate plans to build a cross-exchange symbol map; we can probably just replace the Instrument type with the symbol ticker String, and save a bunch of locks and HashMap lookups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions