Page MenuHomePhabricator

cli: reduce DefaultRequestHandler memory allocations
ClosedPublic

Authored by PiRK on Aug 31 2021, 07:45.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC28f40cef1710: cli: reduce DefaultRequestHandler memory allocations
Summary

Simpler code, fewer allocations. No change of behavior. The code has good test coverage in interface_bitcoin_cli.py.

This is a backport of core#19453

Test Plan

ninja all check-all

Event Timeline

PiRK requested review of this revision.Aug 31 2021, 07:45

Tail of the build log:

[386/445] Running utility command for check-bitcoin-key_tests
[387/445] bitcoin: testing radix_tests
[388/445] Running utility command for check-bitcoin-blockfilter_index_tests
[389/445] bitcoin: testing scheduler_tests
[390/445] Running utility command for check-bitcoin-finalization_tests
[391/445] bitcoin: testing merkleblock_tests
[392/445] bitcoin: testing bip32_tests
[393/445] Running utility command for check-bitcoin-addrman_tests
[394/445] Running utility command for check-bitcoin-config_tests
[395/445] bitcoin: testing schnorr_tests
[396/445] bitcoin: testing sync_tests
[397/445] Running utility command for check-bitcoin-blockindex_tests
[398/445] bitcoin: testing crypto_tests
[399/445] bitcoin: testing torcontrol_tests
[400/445] Running utility command for check-bitcoin-fs_tests
[401/445] Running utility command for check-bitcoin-merkleblock_tests
[402/445] bitcoin: testing settings_tests
[403/445] Running utility command for check-bitcoin-schnorr_tests
[404/445] bitcoin: testing script_tests
[405/445] bitcoin: testing serialize_tests
[406/445] Running utility command for check-bitcoin-torcontrol_tests
[407/445] bitcoin: testing streams_tests
[408/445] Running utility command for check-bitcoin-sync_tests
[409/445] bitcoin: testing timedata_tests
[410/445] Running utility command for check-bitcoin-scheduler_tests
[411/445] bitcoin: testing validation_flush_tests
[412/445] Running utility command for check-bitcoin-script_tests
[413/445] bitcoin: testing compilerbug_tests
[414/445] Running utility command for check-bitcoin-crypto_tests
[415/445] bitcoin: testing checkpoints_tests
[416/445] Running utility command for check-bitcoin-validation_chainstate_tests
[417/445] bitcoin: testing coins_tests
[418/445] bitcoin: testing util_tests
[419/445] Running utility command for check-bitcoin-streams_tests
[420/445] bitcoin: testing validationinterface_tests
[421/445] Running utility command for check-bitcoin-settings_tests
[422/445] bitcoin: testing script_standard_tests
[423/445] Running utility command for check-bitcoin-blockcheck_tests
[424/445] Running utility command for check-bitcoin-checkpoints_tests
[425/445] bitcoin: testing blockstatus_tests
[426/445] bitcoin: testing versionbits_tests
[427/445] Running utility command for check-bitcoin-script_standard_tests
[428/445] bitcoin: testing monolith_opcodes_tests
[429/445] Running utility command for check-bitcoin-serialize_tests
[430/445] bitcoin: testing cashaddr_tests
[431/445] Running utility command for check-bitcoin-timedata_tests
[432/445] Running utility command for check-bitcoin-util_tests
[433/445] Running utility command for check-bitcoin-cashaddr_tests
[434/445] Running utility command for check-bitcoin-validation_flush_tests
[435/445] Running utility command for check-bitcoin-validationinterface_tests
[436/445] Running utility command for check-bitcoin-radix_tests
[437/445] Running utility command for check-bitcoin-coins_tests
[438/445] Running utility command for check-bitcoin-blockstatus_tests
[439/445] Running utility command for check-bitcoin-bswap_tests
[440/445] Running utility command for check-bitcoin-bip32_tests
[441/445] Running utility command for check-bitcoin-monolith_opcodes_tests
[442/445] Running utility command for check-bitcoin-versionbits_tests
[443/445] Running utility command for check-bitcoin-compilerbug_tests
ninja: build stopped: cannot make progress due to previous errors.
Build build-clang-tidy failed with exit code 1

Tail of the build log:

rpc_psbt.py                             | ✓ Passed  | 17 s
rpc_rawtransaction.py                   | ✓ Passed  | 13 s
rpc_scantxoutset.py                     | ✓ Passed  | 3 s
rpc_setban.py                           | ✓ Passed  | 2 s
rpc_signmessage.py                      | ✓ Passed  | 1 s
rpc_signrawtransaction.py               | ✓ Passed  | 1 s
rpc_txoutproof.py                       | ✓ Passed  | 2 s
rpc_uptime.py                           | ✓ Passed  | 1 s
rpc_users.py                            | ✓ Passed  | 5 s
rpc_whitelist.py                        | ✓ Passed  | 1 s
tool_wallet.py                          | ✓ Passed  | 4 s
wallet_abandonconflict.py               | ✓ Passed  | 11 s
wallet_address_types.py                 | ✓ Passed  | 14 s
wallet_avoidreuse.py                    | ✓ Passed  | 4 s
wallet_backup.py                        | ✓ Passed  | 21 s
wallet_balance.py                       | ✓ Passed  | 14 s
wallet_basic.py                         | ✓ Passed  | 27 s
wallet_coinbase_category.py             | ✓ Passed  | 1 s
wallet_create_tx.py                     | ✓ Passed  | 5 s
wallet_createwallet.py                  | ✓ Passed  | 2 s
wallet_createwallet.py --usecli         | ✓ Passed  | 3 s
wallet_descriptor.py                    | ✓ Passed  | 6 s
wallet_disable.py                       | ✓ Passed  | 1 s
wallet_dump.py                          | ✓ Passed  | 4 s
wallet_encryption.py                    | ✓ Passed  | 5 s
wallet_groups.py                        | ✓ Passed  | 21 s
wallet_hd.py                            | ✓ Passed  | 6 s
wallet_import_rescan.py                 | ✓ Passed  | 5 s
wallet_import_with_label.py             | ✓ Passed  | 1 s
wallet_importdescriptors.py             | ✓ Passed  | 4 s
wallet_importmulti.py                   | ✓ Passed  | 3 s
wallet_importprunedfunds.py             | ✓ Passed  | 2 s
wallet_keypool.py                       | ✓ Passed  | 3 s
wallet_keypool_topup.py                 | ✓ Passed  | 2 s
wallet_labels.py                        | ✓ Passed  | 1 s
wallet_listreceivedby.py                | ✓ Passed  | 25 s
wallet_listsinceblock.py                | ✓ Passed  | 4 s
wallet_listtransactions.py              | ✓ Passed  | 6 s
wallet_multiwallet.py                   | ✓ Passed  | 39 s
wallet_multiwallet.py --usecli          | ✓ Passed  | 14 s
wallet_reorgsrestore.py                 | ✓ Passed  | 3 s
wallet_resendwallettransactions.py      | ✓ Passed  | 7 s
wallet_txn_clone.py                     | ✓ Passed  | 1 s
wallet_txn_clone.py --mineblock         | ✓ Passed  | 3 s
wallet_txn_doublespend.py               | ✓ Passed  | 1 s
wallet_txn_doublespend.py --mineblock   | ✓ Passed  | 3 s
wallet_watchonly.py                     | ✓ Passed  | 1 s
wallet_watchonly.py --usecli            | ✓ Passed  | 1 s
wallet_zapwallettxes.py                 | ✓ Passed  | 3 s

ALL                                     | ✓ Passed  | 937 s (accumulated) 
Runtime: 188 s

----------------------------------------------------------------------
Ran 5 tests in 0.001s

OK

ninja: build stopped: cannot make progress due to previous errors.
Build build-diff failed with exit code 1
This revision is now accepted and ready to land.Aug 31 2021, 12:25