-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Backports 0.15 pr21 #3029
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
Backports 0.15 pr21 #3029
Changes from all commits
7708808
9bcadeb
0a21569
184847c
9221e0d
a60f1e2
6e2f779
cf40b54
f1c9b7a
b195cbb
ec01825
28197ef
526036e
09854d6
a0ff957
1717720
b14bd20
29760e7
38f52f8
445e8d8
483786a
6d856ae
d7057d4
c097ab8
188f4a7
2b9216e
0eae9ed
a4f046c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,34 +7,37 @@ | |
| #include "validation.h" | ||
| #include "base58.h" | ||
|
|
||
| #include <array> | ||
|
||
| #include <vector> | ||
| #include <string> | ||
|
|
||
|
|
||
| static void Base58Encode(benchmark::State& state) | ||
| { | ||
| unsigned char buff[32] = { | ||
| 17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147, | ||
| 227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90, | ||
| 200, 24 | ||
| static const std::array<unsigned char, 32> buff = { | ||
| { | ||
| 17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147, | ||
| 227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90, | ||
| 200, 24 | ||
| } | ||
| }; | ||
| unsigned char* b = buff; | ||
| while (state.KeepRunning()) { | ||
| EncodeBase58(b, b + 32); | ||
| EncodeBase58(buff.begin(), buff.end()); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| static void Base58CheckEncode(benchmark::State& state) | ||
| { | ||
| unsigned char buff[32] = { | ||
| 17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147, | ||
| 227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90, | ||
| 200, 24 | ||
| static const std::array<unsigned char, 32> buff = { | ||
| { | ||
| 17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147, | ||
| 227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90, | ||
| 200, 24 | ||
| } | ||
| }; | ||
| unsigned char* b = buff; | ||
| std::vector<unsigned char> vch; | ||
| vch.assign(b, b + 32); | ||
| vch.assign(buff.begin(), buff.end()); | ||
| while (state.KeepRunning()) { | ||
| EncodeBase58Check(vch); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. which makes no sense to do in our case but it's probably ok :)