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

Binary serializer #1172

Closed
wants to merge 2 commits into from
Closed

Binary serializer #1172

wants to merge 2 commits into from

Conversation

MaksymZavershynskyi
Copy link
Contributor

No description provided.

Maksym Zavershynskyi added 2 commits August 14, 2019 17:18
};
}

impl_for_float!(f32, u32);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should have floats at all.

impl_for_integer!(u32);
impl_for_integer!(u64);
impl_for_integer!(u128);
impl_for_integer!(usize);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usize is a bit unclear - as it's different on different platform.
I would actually explicitly not have usize and require cast to u32 or u64 explicitly.

@ilblackdragon
Copy link
Member

Looks great, I'll merge it into my PR, so can make progress there.

@ilblackdragon
Copy link
Member

Just to keep track, bincode benches:

test deserialize_account ... bench:       1,030 ns/iter (+/- 140)
test deserialize_block   ... bench:   2,627,800 ns/iter (+/- 427,695)
test deserialize_tx      ... bench:       2,290 ns/iter (+/- 138)
test serialize_account   ... bench:          78 ns/iter (+/- 16)
test serialize_block     ... bench:   2,180,172 ns/iter (+/- 209,950)
test serialize_tx        ... bench:       2,291 ns/iter (+/- 222)

Will post nbor bench here.

@ilblackdragon
Copy link
Member

First stub after conversion:

test deserialize_account ... bench:         150 ns/iter (+/- 21)
test deserialize_block   ... bench:   3,080,186 ns/iter (+/- 317,673)
test deserialize_tx      ... bench:       2,827 ns/iter (+/- 254)
test serialize_account   ... bench:         482 ns/iter (+/- 89)
test serialize_block     ... bench:     141,669 ns/iter (+/- 31,080)
test serialize_tx        ... bench:         681 ns/iter (+/- 184)

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

Successfully merging this pull request may close these issues.

2 participants