lbrycrd/doc
MarcoFalke 5029e94f85
Merge #14519: tests: add utility to easily profile node performance with perf
13782b8ba8 docs: add perf section to developer docs (James O'Beirne)
58180b5fd4 tests: add utility to easily profile node performance with perf (James O'Beirne)

Pull request description:

  Adds a context manager to easily (and selectively) profile node performance during functional test execution using `perf`.

  While writing some tests, I encountered some odd bitcoind slowness. I wrote up a utility (`TestNode.profile_with_perf`) that generates performance diagnostics for a node by running `perf` during the execution of a particular region of test code.

  `perf` usage is detailed in the excellent (and sadly unmerged) https://github.com/bitcoin/bitcoin/pull/12649; all due props to @eklitzke.

  ### Example

  ```python
  with node.profile_with_perf("large-msgs"):
      for i in range(200):
          node.p2p.send_message(some_large_msg)
      node.p2p.sync_with_ping()
  ```

  This generates a perf data file in the test node's datadir (`/tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data`).

  Running `perf report` generates nice output about where the node spent most of its time while running that part of the test:

  ```bash
  $ perf report -i /tmp/testtxmpod0y/node0/node-0-TestName-large-msgs.perf.data --stdio \
    | c++filt \
    | less

  # To display the perf.data header info, please use --header/--header-only options.
  #
  #
  # Total Lost Samples: 0
  #
  # Samples: 135  of event 'cycles:pp'
  # Event count (approx.): 1458205679493582
  #
  # Children      Self  Command          Shared Object        Symbol
  # ........  ........  ...............  ...................  ........................................................................................................................................................................................................................................................................
  #
      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)
                  |
                  ---CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      70.14%     0.00%  bitcoin-net      bitcoind             [.] CNetMessage::readData(char const*, unsigned int)
                  |
                  ---CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

      35.52%     0.00%  bitcoin-net      bitcoind             [.] std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                  |
                  ---std::vector<char, zero_after_free_allocator<char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<char*, std::vector<char, zero_after_free_allocator<char> > >, unsigned long, char const&)
                     CNetMessage::readData(char const*, unsigned int)
                     CNode::ReceiveMsgBytes(char const*, unsigned int, bool&)

  ...
  ```

Tree-SHA512: 9ac4ceaa88818d5eca00994e8e3c8ad42ae019550d6583972a0a4f7b0c4f61032e3d0c476b4ae58756bc5eb8f8015a19a7fc26c095bd588f31d49a37ed0c6b3e
2019-02-05 17:40:16 -05:00
..
man Bump manpages 2018-12-29 10:26:00 +01:00
release-notes init: Modify docs and add release note for 12255 2019-02-04 09:18:28 -05:00
.gitignore Ignore Doxyfile generated from Doxyfile.in template. 2017-04-07 16:28:12 +02:00
assets-attribution.md [doc] Merge doc/assets-attribution.md into contrib/debian/copyright 2015-09-18 18:14:42 +02:00
benchmarking.md trivial: Fixed typos and cleaned up language 2018-08-02 21:27:16 +08:00
bips.md trivial: Fixed typos and cleaned up language 2018-08-02 21:27:16 +08:00
bitcoin-conf.md Add doc/bitcoin-conf.md 2018-10-19 01:13:57 +03:00
bitcoin_logo_doxygen.png Lossless image optimization 2013-12-02 10:10:22 +01:00
build-freebsd.md FreeBSD: Document Python 3 requirement for 'gmake check' 2018-10-31 02:52:50 -07:00
build-netbsd.md doc: update NetBSD build instructions for 8.0 2018-12-13 12:05:45 +08:00
build-openbsd.md Merge #14515: doc: Update OpenBSD build guide for 6.4 2018-11-05 13:26:37 +01:00
build-osx.md Delete README_osx.md and move its contents into build-osx.md 2019-01-21 20:24:33 +01:00
build-unix.md Various textual improvements in build docs 2018-10-28 06:01:01 +01:00
build-windows.md docs: add NSIS setup/install steps to windows docs 2018-12-13 22:52:17 +08:00
dependencies.md Update zmq to 4.3.1 2019-01-18 10:25:14 +02:00
descriptors.md A few minor formatting fixes and clarifications to descriptors.md 2018-11-22 00:21:29 -05:00
developer-notes.md Merge #14519: tests: add utility to easily profile node performance with perf 2019-02-05 17:40:16 -05:00
dnsseed-policy.md Correct spelling mistakes in doc folder 2015-10-18 06:25:43 +10:00
Doxyfile.in doc: Make build system insert version in Doxyfile 2017-04-05 09:40:56 +02:00
files.md Add nice table to files.md 2018-12-11 22:24:09 +01:00
fuzzing.md test: Build fuzz targets into seperate executables 2019-01-29 19:03:06 -05:00
gitian-building.md doc: move gitian building to external repo 2017-09-25 15:45:38 +02:00
init.md init: Modify docs and add release note for 12255 2019-02-04 09:18:28 -05:00
JSON-RPC-interface.md Doc: add information about security to the JSON-RPC doc 2019-01-23 18:25:44 -05:00
psbt.md Fix minor grammar error in doc 2018-12-20 21:59:56 +00:00
README.md Merge #15132: docs: Add FreeBSD build notes link to doc/README.md 2019-01-10 09:51:03 -05:00
README_windows.txt doc: Remove version numbers from READMEs 2017-04-05 09:40:48 +02:00
reduce-traffic.md trivial: Fixed typos and cleaned up language 2018-08-02 21:27:16 +08:00
release-notes-14941.md doc: Add release notes for unloadwallet change to synchronous call 2019-01-15 00:01:00 +00:00
release-notes-14982.md doc: Add getrpcinfo release notes 2019-01-02 12:47:32 +00:00
release-notes.md [Docs] Small updates to getrawtransaction description 2019-02-04 08:32:08 -08:00
release-process.md Delete README_osx.md and move its contents into build-osx.md 2019-01-21 20:24:33 +01:00
REST-interface.md Merge #14353: REST: add blockhash call, fetch blockhash by height 2019-01-22 19:59:02 -10:00
shared-libraries.md Add NULLDUMMY verify flag in bitcoinconsensus.h 2016-09-30 23:09:19 +08:00
tor.md Less confusing documentation for torpassword 2018-11-26 08:45:32 +08:00
translation_process.md qt: Pre-0.18 split-off translations update 2019-02-04 15:24:37 +01:00
translation_strings_policy.md Docs: Modify policy to not translate command-line help 2018-07-04 09:18:29 +08:00
travis-ci.md [doc] Rework docs 2016-10-04 13:27:38 +02:00
zmq.md ZMQ: add options to configure outbound message high water mark, aka SNDHWM 2018-10-19 07:36:13 -04:00

Bitcoin Core

Setup

Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires a few hundred gigabytes of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more.

To download Bitcoin Core, visit bitcoincore.org.

Running

The following are some helpful notes on how to run Bitcoin Core on your native platform.

Unix

Unpack the files into a directory and run:

  • bin/bitcoin-qt (GUI) or
  • bin/bitcoind (headless)

Windows

Unpack the files into a directory, and then run bitcoin-qt.exe.

macOS

Drag Bitcoin Core to your applications folder, and then run Bitcoin Core.

Need Help?

Building

The following are developer notes on how to build Bitcoin Core on your native platform. They are not complete guides, but include notes on the necessary libraries, compile flags, etc.

Development

The Bitcoin repo's root README contains relevant information on the development process and automated testing.

Resources

Miscellaneous

License

Distributed under the MIT software license. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. This product includes cryptographic software written by Eric Young (eay@cryptsoft.com), and UPnP software written by Thomas Bernard.