-
Notifications
You must be signed in to change notification settings - Fork 67
Remove translation layer #48
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
Draft
meling
wants to merge
42
commits into
master
Choose a base branch
from
avoid-translation-layer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This adds an interface for message types: Proposal, Block and AggQC. Adds a constructor for ProposeMsg. Adds benchmark for translation layer allocation, interface-based construction, and interface field access, direct field access and method field access.
This reverts commit 66939ec.
This adds an interface for message types: Proposal, Block and AggQC. Adds a constructor for ProposeMsg. Adds benchmark for translation layer allocation, interface-based construction, and interface field access, direct field access and method field access.
This reverts commit 66939ec.
This adds a few alternative Block implementations and corresponding benchmarks to better understand their performance. The conclusion so far is that doing pure protobuf allocation is almost 50% faster, but then we can't cache the hash, unless we add the hash field to the proto message. The existing ToBytes implmentation is slighly faster than using protobuf's default Marshal function, but the latter is allocating less... ```sh % go test -v -bench . -benchtime 5s -run x -bench Bench -count 3 goos: darwin goarch: amd64 pkg: github.com/relab/hotstuff/msg cpu: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz BenchmarkNewBlock BenchmarkNewBlock-24 5455846 1098 ns/op 408 B/op 5 allocs/op BenchmarkNewBlock-24 5455090 1095 ns/op 408 B/op 5 allocs/op BenchmarkNewBlock-24 5448262 1093 ns/op 408 B/op 5 allocs/op BenchmarkNewBlockX BenchmarkNewBlockX-24 38660383 151.5 ns/op 152 B/op 3 allocs/op BenchmarkNewBlockX-24 39646353 151.5 ns/op 152 B/op 3 allocs/op BenchmarkNewBlockX-24 39666562 152.5 ns/op 152 B/op 3 allocs/op BenchmarkNewBlockY BenchmarkNewBlockY-24 6527548 919.0 ns/op 264 B/op 5 allocs/op BenchmarkNewBlockY-24 6519303 923.6 ns/op 264 B/op 5 allocs/op BenchmarkNewBlockY-24 6444274 926.5 ns/op 264 B/op 5 allocs/op BenchmarkNewBlockProto BenchmarkNewBlockProto-24 56463015 104.4 ns/op 120 B/op 2 allocs/op BenchmarkNewBlockProto-24 56531526 104.8 ns/op 120 B/op 2 allocs/op BenchmarkNewBlockProto-24 56849295 105.7 ns/op 120 B/op 2 allocs/op BenchmarkToBytes BenchmarkToBytes-24 27228734 219.6 ns/op 248 B/op 4 allocs/op BenchmarkToBytes-24 27296708 221.3 ns/op 248 B/op 4 allocs/op BenchmarkToBytes-24 27144760 221.1 ns/op 248 B/op 4 allocs/op BenchmarkToBytesX BenchmarkToBytesX-24 22433918 261.8 ns/op 64 B/op 1 allocs/op BenchmarkToBytesX-24 22655881 260.7 ns/op 64 B/op 1 allocs/op BenchmarkToBytesX-24 22796553 260.8 ns/op 64 B/op 1 allocs/op BenchmarkToBytesY BenchmarkToBytesY-24 22889803 260.9 ns/op 64 B/op 1 allocs/op BenchmarkToBytesY-24 22500680 260.6 ns/op 64 B/op 1 allocs/op BenchmarkToBytesY-24 22840678 260.2 ns/op 64 B/op 1 allocs/op ```
…nto avoid-translation-layer
…nto avoid-translation-layer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will remove the translation layer to avoid allocations and improve performance.