Commit Graph

46 Commits

Author SHA1 Message Date
MarcoFalke fa821904bf
scripted-diff: Rename test_bitcoin to test/setup_common
-BEGIN VERIFY SCRIPT-
sed -i --regexp-extended -e 's/test_bitcoin\.(h|cpp)/setup_common.\1/g' $(git grep -l test_bitcoin)
git mv ./src/test/test_bitcoin.h   ./src/test/setup_common.h
git mv ./src/test/test_bitcoin.cpp ./src/test/setup_common.cpp
sed -i -e 's/BITCOIN_TEST_TEST_BITCOIN_H/BITCOIN_TEST_SETUP_COMMON_H/g' ./src/test/setup_common.h
-END VERIFY SCRIPT-
2019-04-11 10:12:36 -04:00
MarcoFalke fa8685d49e
test: Use test_bitcoin setup in bench, Add test utils 2019-04-10 15:59:11 -04:00
Wladimir J. van der Laan 208406038c
Merge #15519: Add Poly1305 implementation
e9d5e97561 Poly1305: tolerate the intentional unsigned wraparound in poly1305.cpp (Jonas Schnelli)
b34bf302f2 Add Poly1305 bench (Jonas Schnelli)
03be7f48fa Add Poly1305 implementation (Jonas Schnelli)

Pull request description:

  This adds a currently unused Poly1305 implementation including test vectors from RFC7539.

  Required for BIP151 (and related to #15512).

Tree-SHA512: f8c1ad2f686b980a7498ca50c517e2348ac7b1fe550565156f6c2b20faf764978e4fa6b5b1c3777a16e7a12e2eca3fb57a59be9c788b00d4358ee80f2959edb1
2019-03-27 11:53:15 +01:00
Jonas Schnelli b34bf302f2
Add Poly1305 bench 2019-03-26 18:12:31 +01:00
MarcoFalke 3515612e06
Merge #15473: bench: Benchmark MempoolToJSON
fa38535130 bench: Benchmark MempoolToJSON (MarcoFalke)
fa5dc3534b rpc: Pass mempool into MempoolToJSON (MarcoFalke)

Pull request description:

  This is used in production (e.g. https://jochen-hoenicke.de/queue/#0,24h), so add a benchmark to avoid making it even slower.

  Related:

  * "getrawmempool true RPC call is O(n^2)" #14765

Tree-SHA512: da09d2e54ee261af8671152f97f863cf1acd7a6adc6578e94046b1ec9e647a670c67499760ef765254f65522dfdf773c3c8729006fa2d63ccb6d53166bafc425
2019-03-06 16:58:37 -05:00
MarcoFalke fa38535130
bench: Benchmark MempoolToJSON 2019-02-25 10:13:23 -05:00
Russell Yanofsky 1106a6fde4 Remove use of uiInterface.LoadWallet in wallet code
This also changes the uiInterface.LoadWallet signal argument type from
shared_ptr<CWallet> to unique_ptr<interfaces::Wallet> because CWallet is an
internal wallet class that shouldn't be used in non-wallet code (and also can't
be passed across process boundaries).

This commit does not change behavior.
2019-02-22 15:43:02 -04:00
Russell Yanofsky 00dfb2a440 Remove uses of g_connman in wallet code
This commit does not change behavior.
2019-02-22 15:43:02 -04:00
Jeremy Rubin e4eee7d09d Add Benchmark to test input de-duplication worst case
Fix nits

replace utiltime?
2018-11-25 10:53:20 +09:00
MarcoFalke cccc362d62
build: Remove libssl from LDADD unless gui 2018-09-13 15:53:51 -04:00
Jim Posen 254c85b687 bench: Benchmark GCS filter creation and matching. 2018-08-25 10:02:37 -07:00
Wladimir J. van der Laan acc68bc631
Merge #13586: refactor: add benchmarks to bech32::Encode/Decode
189cf35f3e Add simple bech32 benchmarks (Karl-Johan Alm)

Pull request description:

  This PR adds benchmarks to `Encode()`/`Decode()`.

  The benchmark commit is duplicated in #13632.

Tree-SHA512: 102a193e4af58c9cb23c66d3dc7e174aa6328edab0ed74f92deb7804db5c3d0601807b3e25a5472b5c72d6113cde0dbc9976315644671a8f14ecf349967dbaaa
2018-07-11 11:44:10 +02:00
Karl-Johan Alm 189cf35f3e
Add simple bech32 benchmarks 2018-07-03 12:19:14 +09:00
Ben Woosley 1fabd59e7e
Break circular dependency: init -> * -> init by extracting shutdown.h
Most includers just wanted to react to pending shutdown.

This isolates access to `fRequestShutdown` and limits access to the shutdown
api functions, including the new `AbortShutdown` for setting it to `false`.

Note I originally called `AbortShutdown` `CancelShutdown` but that name was
already taken by winuser.h
https://travis-ci.org/bitcoin/bitcoin/jobs/386913329

This change also triggered a build error in bench. Fixing it required moving LIBBITCOIN_SERVER after LIBBITCOIN_WALLET in bench_bench_bitcoin_LDADD To make
server definitions in src/net.cpp available to wallet methods in
src/wallet/wallet.cpp. Specifically, solving:

  libbitcoin_wallet.a(libbitcoin_wallet_a-wallet.o): In function `CWalletTx::RelayWalletTransaction(CConnman*)':
  wallet.cpp:(.text+0x3f0e): undefined reference to `CConnman::NodeFullyConnected(CNode const*)'
  collect2: error: ld returned 1 exit status

https://travis-ci.org/bitcoin/bitcoin/jobs/392133581

Need for remaining init.h includes confirmed via a thorough search with a more
specific regex:
  \bInterrupt\(\)|\bShutdown\(\)|\bInitLogging\(\)|\bInitParameterInteraction\(\)|\bAppInitBasicSetup\(\)|\bAppInitParameterInteraction\(\)|\bAppInitSanityChecks\(\)|\bAppInitLockDataDirectory\(\)|\bAppInitMain\(\)|\bSetupServerArgs\(\)|\bLicenseInfo\(\)|g_wallet_init_interface|init.h
2018-06-25 00:08:49 -04:00
Wladimir J. van der Laan 08516e0e65
Merge #13219: bench: Add block assemble benchmark
fa0fc1bc7e bench: Add block assemble benchmark (MarcoFalke)

Pull request description:

Tree-SHA512: 614da28020b76154f4cb17752df226466d2d7da7a81f31812e10ca5b94987c7f5abab62b2f45a3a958663bd8cbf2191f3f23e497215196ad7a775f0ea8fb6116
2018-06-24 18:49:23 +02:00
MarcoFalke b22115d9a3
Merge #13312: docs: Add a note about the source code filename naming convention
e56771365b Do not use uppercase characters in source code filenames (practicalswift)
419a1983ca docs: Add a note about the source code filename naming convention (practicalswift)

Pull request description:

  Add a note about the source code filename naming convention.

Tree-SHA512: 8d329bd9e19bcd26e74b0862fb0bc2369b46095dbd3e69d34859908632763abd7c3d00ccc44ee059772ad4bae4460c2bcc1c0e22fd9d8876d57e5fcd346cea4b
2018-06-12 08:02:20 -04:00
Cory Fields f68049dd87 crypto: cleanup sha256 build
Rather than appending all possible cpu variants to all targets, create a
convenience variable that encompasses all.
2018-06-06 17:36:53 -04:00
Pieter Wuille 4437d6e1f3 8-way AVX2 implementation for double SHA256 on 64-byte inputs 2018-05-29 14:18:05 -07:00
Pieter Wuille 230294bf5f 4-way SSE4.1 implementation for double SHA256 on 64-byte inputs 2018-05-29 14:18:05 -07:00
practicalswift e56771365b Do not use uppercase characters in source code filenames 2018-05-23 16:07:37 +02:00
MarcoFalke fa0fc1bc7e
bench: Add block assemble benchmark 2018-05-13 12:45:55 -04:00
Pieter Wuille 0df017889b Benchmark Merkle root computation 2018-05-08 07:44:13 -07:00
Thomas Snider b38200459f benchmark: Removed bench/perf.cpp 2018-04-18 19:53:10 -07:00
Evan Klitzke f0e7aa7020 Add new prevector benchmarks.
This prepares for a series of two additional commits which optimize
prevector performance.
2018-02-27 11:42:06 -08:00
Andrew Chow b98bfc5ed0 Create getaddressinfo RPC and deprecate parts of validateaddress
Moves the parts of validateaddress which require the wallet into getaddressinfo
which is part of the wallet RPCs. Mark those parts of validateaddress which
require the wallet as deprecated.

Validateaddress will  call getaddressinfo
for the data that both share for right now.

Moves IsMine functions to libbitcoin_common and then links libbitcoin_wallet
before libbitcoin_common in order to prevent linker errors since IsMine is no
longer used in libbitcoin_server.
2018-02-16 12:09:32 -05:00
practicalswift f35d033369 build: Make "make clean" remove all files created when running "make check"
More specifically: remove also obj/build.h and bench/data/block413567.raw.h.

Before this patch:

```
$ diff -rq bitcoin-before-make/ bitcoin-after-make-and-make-clean/ | grep -E "^Only in bitcoin-after-make-and-make-clean/" | grep -v dirstamp
Only in bitcoin-after-make-and-make-clean/src/bench/data: block413567.raw.h
Only in bitcoin-after-make-and-make-clean/src/obj: build.h
$
```

After this patch:

```
$ diff -rq bitcoin-before-make/ bitcoin-after-make-and-make-clean/ | grep -E "^Only in bitcoin-after-make-and-make-clean/" | grep -v dirstamp
$
```
2017-10-04 14:54:41 +02:00
Cory Fields 2424989e4f leveldb: enable runtime-detected crc32 instructions 2017-06-09 19:25:36 -07:00
Wladimir J. van der Laan 67ed40ed82
Merge #9505: Prevector Quick Destruct
45a5aaf Only call clear on prevector if it isn't trivially destructible and don't loop in clear (Jeremy Rubin)
aaa02e7 Add prevector destructor benchmark (Jeremy Rubin)

Tree-SHA512: 52bc8163b65b71310252f2d578349d0ddc364a6c23795c5e06e101f5449f04c96cbdca41c0cffb1974b984b8e33006471137d92b8dd4a81a98e922610a94132a
2017-03-14 10:43:10 +01:00
Jeremy Rubin aaa02e7f24 Add prevector destructor benchmark 2017-01-10 18:23:00 -05:00
Jeremy Rubin 9f03110f32 Add Basic CheckQueue Benchmark 2017-01-09 14:07:02 -05:00
Wladimir J. van der Laan 3532818746 bench: Add support for measuring CPU cycles
This adds cycle min/max/avg to the statistics.

Supported on x86 and x86_64 (natively through rdtsc), as well as Linux
(perf syscall).
2016-11-22 12:20:57 +01:00
Luke Dashjr b74ff5cf0c Bugfix: Correctly replace generated headers and fail cleanly
Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
2016-11-12 07:16:28 +00:00
Matt Corallo b2e178a2d2 Add deserialize + CheckBlock benchmarks, and a full block hex 2016-11-09 11:27:59 -08:00
Wladimir J. van der Laan 444c673d85 bench: Add benchmark for lockedpool allocation/deallocation 2016-10-27 13:17:26 +02:00
Russell Yanofsky 18dacf9bd2 Add microbenchmarks to profile more code paths.
The new benchmarks exercise script validation, CCoinsDBView caching,
mempool eviction, and wallet coin selection code.

All of the benchmarks added here are extremely simple and don't
necessarily mirror common real world conditions or interesting
performance edge cases. Details about how specific benchmarks can be
improved are noted in comments.

Github-Issue: #7883
2016-10-18 21:59:05 +02:00
Luke Dashjr f4dffdd6bf Add MIT license to Makefiles 2016-09-21 22:35:12 +00:00
Yuri Zhykin 5fac1f33fb bench: Added base58 encoding/decoding benchmarks 2016-05-27 05:32:58 +03:00
Wladimir J. van der Laan 32114dd634 bench: Add crypto hash benchmarks
Add benchmarks for the cryptographic hash algorithms:

- RIPEMD160
- SHA1
- SHA256
- SHA512

Continues work on #7883.
2016-05-11 19:47:25 +02:00
Pieter Wuille aa62b68745 Benchmark rolling bloom filter 2016-04-28 14:56:32 +02:00
Wladimir J. van der Laan 152a8216cc
Merge #7349: Build against system UniValue when available
42407ed build-unix: Update UniValue build conditions (Luke Dashjr)
cdcad9f LDADD dependency order shuffling (Luke Dashjr)
62f7f2e Bugfix: Always include univalue in DIST_SUBDIRS (Luke Dashjr)
2356515 Change default configure option --with-system-univalue to "no" (Luke Dashjr)
5d3b29b doc: Add UniValue to build instructions (Luke Dashjr)
ab22705 Build against system UniValue when available (Luke Dashjr)
2adf7e2 Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE (Luke Dashjr)
2016-02-04 17:43:19 +01:00
Luke Dashjr cdcad9fc5f LDADD dependency order shuffling 2016-01-31 02:32:55 +00:00
Luke Dashjr 2adf7e2c90 Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE 2016-01-15 04:34:02 +00:00
Jorge Timón a3d5eec546 Build: Consensus: Move consensus files from common to its own module/package 2015-12-08 06:30:14 +01:00
Cory Fields 17c4d9d164 build: Split hardening/fPIE options out
This allows for fPIE to be used selectively.
2015-11-09 22:50:31 -05:00
Gavin Andresen 7072c544b5
Support very-fast-running benchmarks
Avoid calling gettimeofday every time through the benchmarking loop, by keeping
track of how long each loop takes and doubling the number of iterations done
between time checks when they take less than 1/16'th of the total elapsed time.
2015-09-30 09:24:42 -04:00
Gavin Andresen 535ed9223d
Simple benchmarking framework
Benchmarking framework, loosely based on google's micro-benchmarking
library (https://github.com/google/benchmark)

Wny not use the Google Benchmark framework? Because adding Even More Dependencies
isn't worth it. If we get a dozen or three benchmarks and need nanosecond-accurate
timings of threaded code then switching to the full-blown Google Benchmark library
should be considered.

The benchmark framework is hard-coded to run each benchmark for one wall-clock second,
and then spits out .csv-format timing information to stdout. It is left as an
exercise for later (or maybe never) to add command-line arguments to specify which
benchmark(s) to run, how long to run them for, how to format results, etc etc etc.
Again, see the Google Benchmark framework for where that might end up.

See src/bench/MilliSleep.cpp for a sanity-test benchmark that just benchmarks
'sleep 100 milliseconds.'

To compile and run benchmarks:
  cd src; make bench

Sample output:

Benchmark,count,min,max,average
Sleep100ms,10,0.101854,0.105059,0.103881
2015-09-30 09:24:42 -04:00