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

Utils buffer sv2 docs #1232

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

rrybarczyk
Copy link
Collaborator

Addresses #1184.

@rrybarczyk rrybarczyk added documentation Improvements or additions to documentation util Common utilities/helpers protocols Lowest level protocol logic labels Oct 21, 2024
@rrybarczyk rrybarczyk self-assigned this Oct 21, 2024
@rrybarczyk rrybarczyk linked an issue Oct 21, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 25.13%. Comparing base (dee3cae) to head (59c3fa3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1232      +/-   ##
==========================================
+ Coverage   19.30%   25.13%   +5.83%     
==========================================
  Files         164       20     -144     
  Lines       10849     1134    -9715     
==========================================
- Hits         2094      285    -1809     
+ Misses       8755      849    -7906     
Flag Coverage Δ
binary_codec_sv2-coverage ?
binary_serde_sv2-coverage ?
binary_sv2-coverage ?
bip32_derivation-coverage ?
buffer_sv2-coverage ?
codec_sv2-coverage ?
common_messages_sv2-coverage ?
const_sv2-coverage ?
error_handling-coverage ?
framing_sv2-coverage ?
jd_client-coverage ?
jd_server-coverage ?
job_declaration_sv2-coverage ?
key-utils-coverage ?
mining-coverage ?
mining_device-coverage ?
mining_proxy_sv2-coverage ?
noise_sv2-coverage ?
pool_sv2-coverage ?
protocols ?
roles ?
roles_logic_sv2-coverage ?
sv1-mining-device-coverage ?
sv2_ffi-coverage ?
template_distribution_sv2-coverage ?
translator_sv2-coverage ?
utils 25.13% <ø> (ø)
v1-coverage ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Oct 21, 2024

🐰 Bencher Report

Branch1232/merge
Testbedsv2

⚠️ WARNING: The following Measures do not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkEstimated Cyclesestimated cyclesInstructionsinstructionsL1 AccessesaccessesL2 AccessesaccessesRAM Accessesaccesses
client_sv2_handle_message_common📈 view plot
⚠️ NO THRESHOLD
2,137.00📈 view plot
⚠️ NO THRESHOLD
473.00📈 view plot
⚠️ NO THRESHOLD
732.00📈 view plot
⚠️ NO THRESHOLD
8.00📈 view plot
⚠️ NO THRESHOLD
39.00
client_sv2_handle_message_mining📈 view plot
⚠️ NO THRESHOLD
8,204.00📈 view plot
⚠️ NO THRESHOLD
2,137.00📈 view plot
⚠️ NO THRESHOLD
3,159.00📈 view plot
⚠️ NO THRESHOLD
36.00📈 view plot
⚠️ NO THRESHOLD
139.00
client_sv2_mining_message_submit_standard📈 view plot
⚠️ NO THRESHOLD
6,327.00📈 view plot
⚠️ NO THRESHOLD
1,750.00📈 view plot
⚠️ NO THRESHOLD
2,547.00📈 view plot
⚠️ NO THRESHOLD
21.00📈 view plot
⚠️ NO THRESHOLD
105.00
client_sv2_mining_message_submit_standard_serialize📈 view plot
⚠️ NO THRESHOLD
14,712.00📈 view plot
⚠️ NO THRESHOLD
4,694.00📈 view plot
⚠️ NO THRESHOLD
6,757.00📈 view plot
⚠️ NO THRESHOLD
44.00📈 view plot
⚠️ NO THRESHOLD
221.00
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
27,522.00📈 view plot
⚠️ NO THRESHOLD
10,585.00📈 view plot
⚠️ NO THRESHOLD
15,397.00📈 view plot
⚠️ NO THRESHOLD
87.00📈 view plot
⚠️ NO THRESHOLD
334.00
client_sv2_open_channel📈 view plot
⚠️ NO THRESHOLD
4,379.00📈 view plot
⚠️ NO THRESHOLD
1,461.00📈 view plot
⚠️ NO THRESHOLD
2,159.00📈 view plot
⚠️ NO THRESHOLD
10.00📈 view plot
⚠️ NO THRESHOLD
62.00
client_sv2_open_channel_serialize📈 view plot
⚠️ NO THRESHOLD
13,974.00📈 view plot
⚠️ NO THRESHOLD
5,064.00📈 view plot
⚠️ NO THRESHOLD
7,329.00📈 view plot
⚠️ NO THRESHOLD
34.00📈 view plot
⚠️ NO THRESHOLD
185.00
client_sv2_open_channel_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
22,727.00📈 view plot
⚠️ NO THRESHOLD
8,027.00📈 view plot
⚠️ NO THRESHOLD
11,667.00📈 view plot
⚠️ NO THRESHOLD
84.00📈 view plot
⚠️ NO THRESHOLD
304.00
client_sv2_setup_connection📈 view plot
⚠️ NO THRESHOLD
4,715.00📈 view plot
⚠️ NO THRESHOLD
1,502.00📈 view plot
⚠️ NO THRESHOLD
2,275.00📈 view plot
⚠️ NO THRESHOLD
12.00📈 view plot
⚠️ NO THRESHOLD
68.00
client_sv2_setup_connection_serialize📈 view plot
⚠️ NO THRESHOLD
16,140.00📈 view plot
⚠️ NO THRESHOLD
5,963.00📈 view plot
⚠️ NO THRESHOLD
8,665.00📈 view plot
⚠️ NO THRESHOLD
39.00📈 view plot
⚠️ NO THRESHOLD
208.00
client_sv2_setup_connection_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
35,538.00📈 view plot
⚠️ NO THRESHOLD
14,855.00📈 view plot
⚠️ NO THRESHOLD
21,818.00📈 view plot
⚠️ NO THRESHOLD
98.00📈 view plot
⚠️ NO THRESHOLD
378.00
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Oct 21, 2024

🐰 Bencher Report

Branch1232/merge
Testbedsv1

⚠️ WARNING: The following Measures do not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkEstimated Cyclesestimated cyclesInstructionsinstructionsL1 AccessesaccessesL2 AccessesaccessesRAM Accessesaccesses
get_authorize📈 view plot
⚠️ NO THRESHOLD
8,383.00📈 view plot
⚠️ NO THRESHOLD
3,689.00📈 view plot
⚠️ NO THRESHOLD
5,158.00📈 view plot
⚠️ NO THRESHOLD
8.00📈 view plot
⚠️ NO THRESHOLD
91.00
get_submit📈 view plot
⚠️ NO THRESHOLD
95,381.00📈 view plot
⚠️ NO THRESHOLD
59,346.00📈 view plot
⚠️ NO THRESHOLD
85,221.00📈 view plot
⚠️ NO THRESHOLD
44.00📈 view plot
⚠️ NO THRESHOLD
284.00
get_subscribe📈 view plot
⚠️ NO THRESHOLD
7,876.00📈 view plot
⚠️ NO THRESHOLD
2,765.00📈 view plot
⚠️ NO THRESHOLD
3,846.00📈 view plot
⚠️ NO THRESHOLD
15.00📈 view plot
⚠️ NO THRESHOLD
113.00
serialize_authorize📈 view plot
⚠️ NO THRESHOLD
12,210.00📈 view plot
⚠️ NO THRESHOLD
5,266.00📈 view plot
⚠️ NO THRESHOLD
7,325.00📈 view plot
⚠️ NO THRESHOLD
11.00📈 view plot
⚠️ NO THRESHOLD
138.00
serialize_deserialize_authorize📈 view plot
⚠️ NO THRESHOLD
24,306.00📈 view plot
⚠️ NO THRESHOLD
9,838.00📈 view plot
⚠️ NO THRESHOLD
13,891.00📈 view plot
⚠️ NO THRESHOLD
32.00📈 view plot
⚠️ NO THRESHOLD
293.00
serialize_deserialize_handle_authorize📈 view plot
⚠️ NO THRESHOLD
30,016.00📈 view plot
⚠️ NO THRESHOLD
12,015.00📈 view plot
⚠️ NO THRESHOLD
17,001.00📈 view plot
⚠️ NO THRESHOLD
62.00📈 view plot
⚠️ NO THRESHOLD
363.00
serialize_deserialize_handle_submit📈 view plot
⚠️ NO THRESHOLD
126,279.00📈 view plot
⚠️ NO THRESHOLD
73,200.00📈 view plot
⚠️ NO THRESHOLD
104,914.00📈 view plot
⚠️ NO THRESHOLD
108.00📈 view plot
⚠️ NO THRESHOLD
595.00
serialize_deserialize_handle_subscribe📈 view plot
⚠️ NO THRESHOLD
27,392.00📈 view plot
⚠️ NO THRESHOLD
9,584.00📈 view plot
⚠️ NO THRESHOLD
13,547.00📈 view plot
⚠️ NO THRESHOLD
67.00📈 view plot
⚠️ NO THRESHOLD
386.00
serialize_deserialize_submit📈 view plot
⚠️ NO THRESHOLD
115,049.00📈 view plot
⚠️ NO THRESHOLD
68,060.00📈 view plot
⚠️ NO THRESHOLD
97,659.00📈 view plot
⚠️ NO THRESHOLD
62.00📈 view plot
⚠️ NO THRESHOLD
488.00
serialize_deserialize_subscribe📈 view plot
⚠️ NO THRESHOLD
22,820.00📈 view plot
⚠️ NO THRESHOLD
8,143.00📈 view plot
⚠️ NO THRESHOLD
11,465.00📈 view plot
⚠️ NO THRESHOLD
38.00📈 view plot
⚠️ NO THRESHOLD
319.00
serialize_submit📈 view plot
⚠️ NO THRESHOLD
99,770.00📈 view plot
⚠️ NO THRESHOLD
61,408.00📈 view plot
⚠️ NO THRESHOLD
88,080.00📈 view plot
⚠️ NO THRESHOLD
49.00📈 view plot
⚠️ NO THRESHOLD
327.00
serialize_subscribe📈 view plot
⚠️ NO THRESHOLD
11,321.00📈 view plot
⚠️ NO THRESHOLD
4,118.00📈 view plot
⚠️ NO THRESHOLD
5,706.00📈 view plot
⚠️ NO THRESHOLD
17.00📈 view plot
⚠️ NO THRESHOLD
158.00
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Oct 21, 2024

🐰 Bencher Report

Branch1232/merge
Testbedsv1

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
client-submit-serialize📈 view plot
⚠️ NO THRESHOLD
6,782.20
client-submit-serialize-deserialize📈 view plot
⚠️ NO THRESHOLD
7,407.60
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
⚠️ NO THRESHOLD
8,156.30
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
⚠️ NO THRESHOLD
872.09
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
⚠️ NO THRESHOLD
668.84
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
⚠️ NO THRESHOLD
247.90
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
⚠️ NO THRESHOLD
157.50
client-sv1-get-submit📈 view plot
⚠️ NO THRESHOLD
6,509.40
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
⚠️ NO THRESHOLD
277.70
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
⚠️ NO THRESHOLD
730.09
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
⚠️ NO THRESHOLD
590.27
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
⚠️ NO THRESHOLD
206.85
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Oct 21, 2024

🐰 Bencher Report

Branch1232/merge
Testbedsv2

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
client_sv2_handle_message_common📈 view plot
⚠️ NO THRESHOLD
44.15
client_sv2_handle_message_mining📈 view plot
⚠️ NO THRESHOLD
75.40
client_sv2_mining_message_submit_standard📈 view plot
⚠️ NO THRESHOLD
14.67
client_sv2_mining_message_submit_standard_serialize📈 view plot
⚠️ NO THRESHOLD
265.90
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
582.17
client_sv2_open_channel📈 view plot
⚠️ NO THRESHOLD
149.11
client_sv2_open_channel_serialize📈 view plot
⚠️ NO THRESHOLD
291.66
client_sv2_open_channel_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
375.21
client_sv2_setup_connection📈 view plot
⚠️ NO THRESHOLD
160.56
client_sv2_setup_connection_serialize📈 view plot
⚠️ NO THRESHOLD
493.74
client_sv2_setup_connection_serialize_deserialize📈 view plot
⚠️ NO THRESHOLD
967.66
🐰 View full continuous benchmarking report in Bencher

@rrybarczyk rrybarczyk force-pushed the utils-buffer-sv2-docs branch 7 times, most recently from bf95e9b to d8c1798 Compare October 22, 2024 11:49
utils/buffer/src/slice.rs Outdated Show resolved Hide resolved
utils/buffer/src/slice.rs Outdated Show resolved Hide resolved
utils/buffer/src/slice.rs Outdated Show resolved Hide resolved
utils/buffer/src/slice.rs Outdated Show resolved Hide resolved
utils/buffer/src/slice.rs Outdated Show resolved Hide resolved
utils/buffer/src/buffer_pool/pool_back.rs Outdated Show resolved Hide resolved
utils/buffer/src/buffer_pool/pool_back.rs Outdated Show resolved Hide resolved
utils/buffer/src/buffer_pool/pool_back.rs Outdated Show resolved Hide resolved
utils/buffer/src/buffer_pool/pool_back.rs Outdated Show resolved Hide resolved
utils/buffer/examples/buffer_pool_exhaustion.rs Outdated Show resolved Hide resolved
@rrybarczyk rrybarczyk force-pushed the utils-buffer-sv2-docs branch 5 times, most recently from 74fc730 to 3137545 Compare November 5, 2024 00:45
@rrybarczyk rrybarczyk changed the title [WIP] Utils buffer sv2 docs Utils buffer sv2 docs Nov 5, 2024
@rrybarczyk rrybarczyk marked this pull request as ready for review November 5, 2024 16:09
@rrybarczyk rrybarczyk force-pushed the utils-buffer-sv2-docs branch 3 times, most recently from db7a330 to 49ac424 Compare November 5, 2024 16:12
@rrybarczyk rrybarczyk requested a review from Fi3 November 5, 2024 16:12
utils/buffer/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Nov 11, 2024

🐰 Bencher Report

Branchutils-buffer-sv2-docs
Testbedsv2
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
45.41
(+0.86%)
47.13
(96.35%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
77.70
(+2.68%)
88.98
(87.33%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
14.66
(+0.03%)
14.76
(99.29%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
287.05
(+5.56%)
339.67
(84.51%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
588.88
(+0.24%)
680.95
(86.48%)
client_sv2_open_channel📈 view plot
🚷 view threshold
150.61
(+2.22%)
157.08
(95.88%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
283.44
(-1.04%)
317.53
(89.26%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
376.20
(-0.10%)
421.35
(89.29%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
159.97
(-1.08%)
184.60
(86.66%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
488.92
(+3.38%)
606.67
(80.59%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
1,002.70
(+3.25%)
1,123.70
(89.23%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 11, 2024

🐰 Bencher Report

Branchutils-buffer-sv2-docs
Testbedsv1
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
nanoseconds (ns)
(Result Δ%)
Upper Boundary
nanoseconds (ns)
(Limit %)
client-submit-serialize📈 view plot
🚷 view threshold
6,764.70
(-0.12%)
7,966.31
(84.92%)
client-submit-serialize-deserialize📈 view plot
🚷 view threshold
7,582.40
(-1.17%)
9,009.80
(84.16%)
client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle📈 view plot
🚷 view threshold
8,249.50
(-0.01%)
9,513.44
(86.71%)
client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle📈 view plot
🚷 view threshold
866.29
(-1.75%)
1,021.67
(84.79%)
client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize📈 view plot
🚷 view threshold
675.34
(-0.73%)
829.37
(81.43%)
client-sv1-authorize-serialize/client-sv1-authorize-serialize📈 view plot
🚷 view threshold
249.80
(+0.71%)
265.71
(94.01%)
client-sv1-get-authorize/client-sv1-get-authorize📈 view plot
🚷 view threshold
158.64
(+0.64%)
165.40
(95.91%)
client-sv1-get-submit📈 view plot
🚷 view threshold
6,381.50
(-2.20%)
7,919.58
(80.58%)
client-sv1-get-subscribe/client-sv1-get-subscribe📈 view plot
🚷 view threshold
276.90
(-0.73%)
314.73
(87.98%)
client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle📈 view plot
🚷 view threshold
722.75
(-2.98%)
895.71
(80.69%)
client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize📈 view plot
🚷 view threshold
594.72
(-1.76%)
712.73
(83.44%)
client-sv1-subscribe-serialize/client-sv1-subscribe-serialize📈 view plot
🚷 view threshold
204.18
(-0.99%)
227.01
(89.94%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 11, 2024

🐰 Bencher Report

Branchutils-buffer-sv2-docs
Testbedsv1
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
get_authorize📈 view plot
🚷 view threshold
8,391.00
(-0.77%)
8,829.55
(95.03%)
📈 view plot
🚷 view threshold
3,689.00
(-1.57%)
3,890.95
(94.81%)
📈 view plot
🚷 view threshold
5,156.00
(-1.91%)
5,458.66
(94.46%)
📈 view plot
🚷 view threshold
10.00
(+40.35%)
12.50
(79.97%)
📈 view plot
🚷 view threshold
91.00
(+0.65%)
96.19
(94.60%)
get_submit📈 view plot
🚷 view threshold
95,453.00
(+0.01%)
96,154.14
(99.27%)
📈 view plot
🚷 view threshold
59,346.00
(-0.21%)
59,815.75
(99.21%)
📈 view plot
🚷 view threshold
85,218.00
(-0.24%)
85,914.28
(99.19%)
📈 view plot
🚷 view threshold
45.00
(-0.98%)
65.54
(68.66%)
📈 view plot
🚷 view threshold
286.00
(+2.18%)
289.55
(98.77%)
get_subscribe📈 view plot
🚷 view threshold
7,872.00
(-1.78%)
8,385.35
(93.88%)
📈 view plot
🚷 view threshold
2,765.00
(-2.44%)
2,970.86
(93.07%)
📈 view plot
🚷 view threshold
3,847.00
(-2.90%)
4,151.92
(92.66%)
📈 view plot
🚷 view threshold
14.00
(+16.59%)
20.75
(67.46%)
📈 view plot
🚷 view threshold
113.00
(-0.95%)
120.15
(94.05%)
serialize_authorize📈 view plot
🚷 view threshold
12,214.00
(-0.49%)
12,650.29
(96.55%)
📈 view plot
🚷 view threshold
5,266.00
(-1.00%)
5,461.05
(96.43%)
📈 view plot
🚷 view threshold
7,324.00
(-1.28%)
7,620.55
(96.11%)
📈 view plot
🚷 view threshold
12.00
(+33.22%)
15.58
(77.03%)
📈 view plot
🚷 view threshold
138.00
(+0.41%)
143.62
(96.09%)
serialize_deserialize_authorize📈 view plot
🚷 view threshold
24,344.00
(-1.36%)
25,290.85
(96.26%)
📈 view plot
🚷 view threshold
9,838.00
(-0.54%)
10,054.66
(97.85%)
📈 view plot
🚷 view threshold
13,889.00
(-0.54%)
14,208.50
(97.75%)
📈 view plot
🚷 view threshold
33.00
(-5.01%)
44.09
(74.85%)
📈 view plot
🚷 view threshold
294.00
(-2.39%)
316.04
(93.03%)
serialize_deserialize_handle_authorize📈 view plot
🚷 view threshold
30,088.00
(-0.75%)
30,801.44
(97.68%)
📈 view plot
🚷 view threshold
12,015.00
(-0.56%)
12,225.38
(98.28%)
📈 view plot
🚷 view threshold
16,998.00
(-0.65%)
17,317.53
(98.15%)
📈 view plot
🚷 view threshold
63.00
(+13.02%)
68.38
(92.13%)
📈 view plot
🚷 view threshold
365.00
(-1.17%)
382.16
(95.51%)
serialize_deserialize_handle_submit📈 view plot
🚷 view threshold
126,471.00
(-0.00%)
127,200.85
(99.43%)
📈 view plot
🚷 view threshold
73,200.00
(-0.12%)
73,699.14
(99.32%)
📈 view plot
🚷 view threshold
104,911.00
(-0.15%)
105,668.01
(99.28%)
📈 view plot
🚷 view threshold
105.00
(-2.25%)
134.54
(78.04%)
📈 view plot
🚷 view threshold
601.00
(+0.81%)
605.60
(99.24%)
serialize_deserialize_handle_subscribe📈 view plot
🚷 view threshold
27,476.00
(-1.24%)
28,656.12
(95.88%)
📈 view plot
🚷 view threshold
9,584.00
(-0.66%)
9,790.17
(97.89%)
📈 view plot
🚷 view threshold
13,541.00
(-0.77%)
13,850.12
(97.77%)
📈 view plot
🚷 view threshold
71.00
(+11.76%)
76.20
(93.18%)
📈 view plot
🚷 view threshold
388.00
(-2.00%)
417.43
(92.95%)
serialize_deserialize_submit📈 view plot
🚷 view threshold
115,163.00
(-0.07%)
115,990.40
(99.29%)
📈 view plot
🚷 view threshold
68,060.00
(-0.07%)
68,513.05
(99.34%)
📈 view plot
🚷 view threshold
97,653.00
(-0.09%)
98,354.05
(99.29%)
📈 view plot
🚷 view threshold
65.00
(+3.23%)
78.98
(82.30%)
📈 view plot
🚷 view threshold
491.00
(+0.00%)
499.67
(98.27%)
serialize_deserialize_subscribe📈 view plot
🚷 view threshold
22,850.00
(-1.68%)
24,084.36
(94.87%)
📈 view plot
🚷 view threshold
8,143.00
(-0.73%)
8,346.75
(97.56%)
📈 view plot
🚷 view threshold
11,465.00
(-0.78%)
11,757.48
(97.51%)
📈 view plot
🚷 view threshold
37.00
(-0.94%)
44.62
(82.92%)
📈 view plot
🚷 view threshold
320.00
(-2.60%)
349.37
(91.59%)
serialize_submit📈 view plot
🚷 view threshold
99,854.00
(-0.01%)
100,524.67
(99.33%)
📈 view plot
🚷 view threshold
61,408.00
(-0.18%)
61,861.67
(99.27%)
📈 view plot
🚷 view threshold
88,074.00
(-0.22%)
88,762.92
(99.22%)
📈 view plot
🚷 view threshold
53.00
(+12.26%)
65.99
(80.32%)
📈 view plot
🚷 view threshold
329.00
(+1.37%)
334.04
(98.49%)
serialize_subscribe📈 view plot
🚷 view threshold
11,317.00
(-0.70%)
11,761.88
(96.22%)
📈 view plot
🚷 view threshold
4,118.00
(-1.52%)
4,316.83
(95.39%)
📈 view plot
🚷 view threshold
5,707.00
(-1.92%)
6,007.89
(94.99%)
📈 view plot
🚷 view threshold
16.00
(+24.42%)
20.66
(77.46%)
📈 view plot
🚷 view threshold
158.00
(+0.30%)
164.08
(96.30%)
🐰 View full continuous benchmarking report in Bencher

Copy link
Contributor

github-actions bot commented Nov 11, 2024

🐰 Bencher Report

Branchutils-buffer-sv2-docs
Testbedsv2
🚨 1 ALERT: Threshold Boundary Limit exceeded!
BenchmarkMeasure
Units
ViewBenchmark Result
(Result Δ%)
Lower Boundary
(Limit %)
Upper Boundary
(Limit %)
client_sv2_open_channel_serialize_deserializeL2 Accesses
accesses
📈 plot
🚨 alert
🚷 threshold
87.00
(+17.16%)
85.08
(102.26%)
Click to view all benchmark results
BenchmarkEstimated CyclesBenchmark Result
estimated cycles
(Result Δ%)
Upper Boundary
estimated cycles
(Limit %)
InstructionsBenchmark Result
instructions
(Result Δ%)
Upper Boundary
instructions
(Limit %)
L1 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
L2 AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
RAM AccessesBenchmark Result
accesses
(Result Δ%)
Upper Boundary
accesses
(Limit %)
client_sv2_handle_message_common📈 view plot
🚷 view threshold
2,201.00
(+5.18%)
2,207.89
(99.69%)
📈 view plot
🚷 view threshold
473.00
(-0.04%)
488.74
(96.78%)
📈 view plot
🚷 view threshold
731.00
(-0.63%)
757.85
(96.46%)
📈 view plot
🚷 view threshold
7.00
(+26.91%)
14.29
(48.98%)
📈 view plot
🚷 view threshold
41.00
(+7.94%)
41.21
(99.48%)
client_sv2_handle_message_mining📈 view plot
🚷 view threshold
8,216.00
(+0.12%)
8,290.58
(99.10%)
📈 view plot
🚷 view threshold
2,137.00
(-0.03%)
2,143.08
(99.72%)
📈 view plot
🚷 view threshold
3,156.00
(-0.15%)
3,170.59
(99.54%)
📈 view plot
🚷 view threshold
39.00
(+9.43%)
42.39
(92.00%)
📈 view plot
🚷 view threshold
139.00
(-0.05%)
140.97
(98.60%)
client_sv2_mining_message_submit_standard📈 view plot
🚷 view threshold
6,361.00
(+1.31%)
6,389.85
(99.55%)
📈 view plot
🚷 view threshold
1,750.00
(-0.04%)
1,767.13
(99.03%)
📈 view plot
🚷 view threshold
2,546.00
(-0.30%)
2,576.25
(98.83%)
📈 view plot
🚷 view threshold
21.00
(+23.42%)
24.81
(84.66%)
📈 view plot
🚷 view threshold
106.00
(+1.92%)
107.03
(99.04%)
client_sv2_mining_message_submit_standard_serialize📈 view plot
🚷 view threshold
14,758.00
(+0.17%)
14,972.34
(98.57%)
📈 view plot
🚷 view threshold
4,694.00
(-0.02%)
4,711.13
(99.64%)
📈 view plot
🚷 view threshold
6,753.00
(-0.08%)
6,782.82
(99.56%)
📈 view plot
🚷 view threshold
47.00
(+7.99%)
53.47
(87.90%)
📈 view plot
🚷 view threshold
222.00
(+0.17%)
227.92
(97.40%)
client_sv2_mining_message_submit_standard_serialize_deserialize📈 view plot
🚷 view threshold
27,552.00
(+0.10%)
27,705.48
(99.45%)
📈 view plot
🚷 view threshold
10,585.00
(+0.07%)
10,634.19
(99.54%)
📈 view plot
🚷 view threshold
15,397.00
(+0.04%)
15,477.54
(99.48%)
📈 view plot
🚷 view threshold
86.00
(+5.84%)
89.45
(96.14%)
📈 view plot
🚷 view threshold
335.00
(-0.01%)
341.36
(98.14%)
client_sv2_open_channel📈 view plot
🚷 view threshold
4,413.00
(+0.32%)
4,620.49
(95.51%)
📈 view plot
🚷 view threshold
1,461.00
(-0.01%)
1,476.74
(98.93%)
📈 view plot
🚷 view threshold
2,158.00
(-0.07%)
2,185.47
(98.74%)
📈 view plot
🚷 view threshold
10.00
(+10.73%)
17.86
(55.99%)
📈 view plot
🚷 view threshold
63.00
(+0.49%)
68.62
(91.81%)
client_sv2_open_channel_serialize📈 view plot
🚷 view threshold
14,044.00
(-0.15%)
14,467.93
(97.07%)
📈 view plot
🚷 view threshold
5,064.00
(-0.00%)
5,079.74
(99.69%)
📈 view plot
🚷 view threshold
7,319.00
(-0.09%)
7,353.27
(99.53%)
📈 view plot
🚷 view threshold
43.00
(+22.26%)
43.59
(98.65%)
📈 view plot
🚷 view threshold
186.00
(-0.82%)
199.15
(93.40%)
client_sv2_open_channel_serialize_deserialize📈 view plot
🚷 view threshold
22,773.00
(+0.49%)
22,894.96
(99.47%)
📈 view plot
🚷 view threshold
8,027.00
(+0.10%)
8,074.55
(99.41%)
📈 view plot
🚷 view threshold
11,663.00
(-0.02%)
11,755.46
(99.21%)
📈 view plot
🚨 view alert
🚷 view threshold
87.00
(+17.16%)
85.08
(102.26%)
📈 view plot
🚷 view threshold
305.00
(+0.46%)
312.01
(97.75%)
client_sv2_setup_connection📈 view plot
🚷 view threshold
4,753.00
(+1.46%)
4,774.63
(99.55%)
📈 view plot
🚷 view threshold
1,502.00
(-0.01%)
1,517.74
(98.96%)
📈 view plot
🚷 view threshold
2,273.00
(-0.24%)
2,299.54
(98.85%)
📈 view plot
🚷 view threshold
13.00
(+40.42%)
15.60
(83.35%)
📈 view plot
🚷 view threshold
69.00
(+2.34%)
69.90
(98.71%)
client_sv2_setup_connection_serialize📈 view plot
🚷 view threshold
16,202.00
(+0.16%)
16,476.65
(98.33%)
📈 view plot
🚷 view threshold
5,963.00
(-0.00%)
5,978.74
(99.74%)
📈 view plot
🚷 view threshold
8,657.00
(-0.07%)
8,692.86
(99.59%)
📈 view plot
🚷 view threshold
46.00
(+14.82%)
53.79
(85.51%)
📈 view plot
🚷 view threshold
209.00
(+0.04%)
216.77
(96.42%)
client_sv2_setup_connection_serialize_deserialize📈 view plot
🚷 view threshold
35,580.00
(+0.09%)
35,732.94
(99.57%)
📈 view plot
🚷 view threshold
14,855.00
(+0.06%)
14,903.58
(99.67%)
📈 view plot
🚷 view threshold
21,815.00
(+0.03%)
21,913.01
(99.55%)
📈 view plot
🚷 view threshold
100.00
(+7.49%)
114.77
(87.13%)
📈 view plot
🚷 view threshold
379.00
(-0.07%)
384.68
(98.52%)
🐰 View full continuous benchmarking report in Bencher

@rrybarczyk rrybarczyk force-pushed the utils-buffer-sv2-docs branch 6 times, most recently from 5a30170 to 1ff713b Compare November 11, 2024 21:26
@rrybarczyk rrybarczyk force-pushed the utils-buffer-sv2-docs branch 2 times, most recently from dfdb488 to c7cc945 Compare November 13, 2024 15:59
Copy link
Collaborator

@GitGab19 GitGab19 left a comment

Choose a reason for hiding this comment

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

Partial review, I will complete it in some hours, but some answers to my comments would make me easier to complete the review 🙏

## Intro
`BufferPool` is useful whenever we need to work with buffers sequentially (fill a buffer, get
the filled buffer, fill a new buffer, get the filled buffer, and so on).
`buffer_sv2` handles memory management for Stratum v2 (Sv2) roles. It provides a memory-efficient
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
`buffer_sv2` handles memory management for Stratum v2 (Sv2) roles. It provides a memory-efficient
`buffer_sv2` handles memory management for Stratum V2 (Sv2) roles. It provides a memory-efficient

4. Using the header and message to construct a
[`framing_sv2::framing::Frame`](https://docs.rs/framing_sv2/2.0.0/framing_sv2/framing/enum.Frame.html).

To fill the buffer, the `codec_sv2` decoder must bass a reference of the buffer to a filler. To
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
To fill the buffer, the `codec_sv2` decoder must bass a reference of the buffer to a filler. To
To fill the buffer, the `codec_sv2` decoder must pass a reference of the buffer to a filler. To

If so use it, then check if the second slot has been dropped, and so on.
`BufferPool` is also optimized to drop all the slices.
`BufferPool` is also optimized to drop the last slice.
`BufferPool` can only be fragmented between the front and back and between back and end.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does this mean? I'm having some problems in understanding how this back, front and end works tbh.

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently, only prefix and suffix slots can be used; intermediary slots are not supported.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you expand more?

There are 8 slot
#### Fragmentation, Overflow, and Optimization
`BufferPool` can allocate a maximum of `8` `Slice`s (as it uses an `AtomicU8` to track used and
freed slots) and up to the defined capacity in bytes. If all `8` slows are taken or there is no more
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
freed slots) and up to the defined capacity in bytes. If all `8` slows are taken or there is no more
freed slots) and up to the defined capacity in bytes. If all `8` slots are taken or there is no more


`BufferPool` is benchmarked against `BufferFromSystemMemory` and two additional structure for
reference: `PPool` (a hashmap-based pool) and `MaxEfficeincy` (a highly optimized but unrealistic
control implementation writen such that the benchmarks do not panic and the compiler does not
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
control implementation writen such that the benchmarks do not panic and the compiler does not
control implementation written such that the benchmarks do not panic and the compiler does not

Copy link
Collaborator

Choose a reason for hiding this comment

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

In CASE 1, we have:

12345678  BACK MODE
12345698  BACK MODE

Why don't we have:

12345678  BACK MODE
12345679  BACK MODE

?


// Retrieve the data as an owned slice
let data_slice = buffer_pool.get_data_owned();
assert_eq!(buffer_pool.len(), 0); // Buffer is now empty
Copy link
Collaborator

Choose a reason for hiding this comment

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

So it is not empty after you retrieve data with get_data_owned?

let mut slices = VecDeque::new();

// Write data to fill back slots
for _ in 0..4 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this be for _ in 0..8 ? Otherwise only 4 bytes are going to be written, but you defined a 8 bytes capacity. Maybe I'm missing something

// buffer
writable.copy_from_slice(data_bytes);
let data_slice = buffer_pool.get_data_owned(); // Take ownership of allocated segment
slices.push_back(data_slice);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or maybe you're adding the last 4 bytes here?

Comment on lines +26 to +33
// Underlying buffer storing the data.
inner: Vec<u8>,

// Current cursor indicating where the next byte should be written.
cursor: usize,

// Starting index for the buffer. Useful for scenarios where part of the buffer is skipped or
// invalid.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't these comments be public docs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation protocols Lowest level protocol logic util Common utilities/helpers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need Rust docs for utils::buffer
4 participants