Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a benchmark for lots of tiny objects to measure latency #83

Open
coderedart opened this issue Jun 22, 2024 · 4 comments
Open

Add a benchmark for lots of tiny objects to measure latency #83

coderedart opened this issue Jun 22, 2024 · 4 comments

Comments

@coderedart
Copy link

It seems most of the benchmarks are focusing on serializing/deserializing a single piece of huge data. It would be nice to have a benchmark focusing on lots of small data.

In a lot of real world cases, we deal with lots of small messages (<1KB), rather than huge 1MB+ files. So, It could be a useful benchmark.

@djkoloski
Copy link
Owner

I think this is a good idea. It would also provide some pressure to reduce the overhead involved in performing a single serialization operation.

@mumbleskates
Copy link
Contributor

since each of the benchmarks' data is represented as an outer vector of smaller data, this could be accomplished by moving the benchmarked action down one level of nesting. this just omits the cost of whatever bookkeeping is involved in that outer packaging. this could probably be done with relatively little code...

@louaykamel
Copy link
Contributor

louaykamel commented Jul 10, 2024

Agreed, I would love if we can have something similar but for primitive types bench example.

@finnbear
Copy link
Contributor

IMO the real world use case of high-frequency trading would be a good fit:

/// One per call to serialize/deserialize.
struct Order {
	sequence_number: u32,
        ticker: String,
	account: String,
	order_type: OrderType,
	side: Side,
	time_in_force: TimeInForce,
}

/// https://www.onixs.biz/fix-dictionary/4.4/tagnum_40.html
enum OrderType {
	Market,
	Limit,
}

/// https://www.onixs.biz/fix-dictionary/4.4/tagnum_54.html
enum Side {
	Buy,
	Sell,
	SellShort,
}

/// https://www.onixs.biz/fix-dictionary/4.4/tagnum_59.html
enum TimeInForce {
	Day,
	GoodTillCancel,
	AtTheOpening,
	ImmediateOrCancel,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants