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

protocol: benchmarks for protocol parsing #4

Merged
merged 1 commit into from
Feb 2, 2019
Merged

protocol: benchmarks for protocol parsing #4

merged 1 commit into from
Feb 2, 2019

Conversation

changkun
Copy link
Owner

@changkun changkun commented Feb 2, 2019

This intend to give a benchmark comparison between Guacamole protocol and Occamy protocol design.

name                          old time/op    new time/op    delta
InstructionParser/occamy-0-6     325ns ± 2%     126ns ± 3%  -61.16%  (p=0.000 n=10+9)
InstructionParser/occamy-1-6    54.3µs ± 1%     1.2µs ± 9%  -97.73%  (p=0.000 n=9+10)

name                          old alloc/op   new alloc/op   delta
InstructionParser/occamy-0-6      120B ± 0%       96B ± 0%  -20.00%  (p=0.000 n=10+10)
InstructionParser/occamy-1-6    36.4kB ± 0%     8.3kB ± 0%  -77.26%  (p=0.000 n=10+10)

name                          old allocs/op  new allocs/op  delta
InstructionParser/occamy-0-6      7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
InstructionParser/occamy-1-6      23.0 ± 0%       3.0 ± 0%  -86.96%  (p=0.000 n=10+10)

As we can see, eliminate the numbers of instruction length reduces the parsing cost significantly.

See #3.

This intend to give a benchmark comparison between Guacamole protocol and Occamy protocol design.

name                          old time/op    new time/op    delta
InstructionParser/occamy-0-6     325ns ± 2%     126ns ± 3%  -61.16%  (p=0.000 n=10+9)
InstructionParser/occamy-1-6    54.3µs ± 1%     1.2µs ± 9%  -97.73%  (p=0.000 n=9+10)

name                          old alloc/op   new alloc/op   delta
InstructionParser/occamy-0-6      120B ± 0%       96B ± 0%  -20.00%  (p=0.000 n=10+10)
InstructionParser/occamy-1-6    36.4kB ± 0%     8.3kB ± 0%  -77.26%  (p=0.000 n=10+10)

name                          old allocs/op  new allocs/op  delta
InstructionParser/occamy-0-6      7.00 ± 0%      3.00 ± 0%  -57.14%  (p=0.000 n=10+10)
InstructionParser/occamy-1-6      23.0 ± 0%       3.0 ± 0%  -86.96%  (p=0.000 n=10+10)

As we can see, eliminate the numbers of instruction length reduces the parsing cost significantly.

See #3.
@changkun changkun self-assigned this Feb 2, 2019
@changkun changkun merged commit 4582de1 into master Feb 2, 2019
@changkun changkun deleted the issue_3 branch February 2, 2019 20:47
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.

1 participant