Skip to content

sc-client-db: Make jemalloc optional#10590

Merged
bkchr merged 2 commits intomasterfrom
bkchr-jemalloc-optional
Dec 10, 2025
Merged

sc-client-db: Make jemalloc optional#10590
bkchr merged 2 commits intomasterfrom
bkchr-jemalloc-optional

Conversation

@bkchr
Copy link
Copy Markdown
Member

@bkchr bkchr commented Dec 10, 2025

This changes sc-client-db to not always enable jemalloc by default for rocksdb. Instead it is now controlled by jemalloc-allocator feature. This is now also forwarded up to polkadot via polkadot-cli and sc-service. There we ultimately decide if jemalloc should be enabled or not.

This changes `sc-client-db` to not always enable `jemalloc` by default for rocksdb. Instead it is now controlled by
`jemalloc-allocator` feature. This is now also forwarded up to `polkadot` via `polkadot-cli` and `sc-service`.
There we ultimately decide if `jemalloc` should be enabled or not.
@bkchr bkchr added the T0-node This PR/Issue is related to the topic “node”. label Dec 10, 2025
@bkchr
Copy link
Copy Markdown
Member Author

bkchr commented Dec 10, 2025

/cmd prdoc --audience node_dev --bump minor

@bkchr bkchr enabled auto-merge December 10, 2025 12:13
@bkchr bkchr added the A4-backport-stable2512 Pull request must be backported to the stable2512 release branch label Dec 10, 2025
@bkchr bkchr added this pull request to the merge queue Dec 10, 2025
Merged via the queue into master with commit 7ef1751 Dec 10, 2025
310 of 318 checks passed
@bkchr bkchr deleted the bkchr-jemalloc-optional branch December 10, 2025 13:22
paritytech-release-backport-bot bot pushed a commit that referenced this pull request Dec 10, 2025
This changes `sc-client-db` to not always enable `jemalloc` by default
for rocksdb. Instead it is now controlled by `jemalloc-allocator`
feature. This is now also forwarded up to `polkadot` via `polkadot-cli`
and `sc-service`. There we ultimately decide if `jemalloc` should be
enabled or not.

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 7ef1751)
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2512:

EgorPopelyaev pushed a commit that referenced this pull request Dec 10, 2025
Backport #10590 into `stable2512` from bkchr.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
sigurpol added a commit that referenced this pull request Feb 13, 2026
Fix huge benchmark regression for storage-heavy extrinsics, enabling
jemalloc-allocator for benchmarking, marked as option in the scope of
PR #10590.
github-merge-queue bot pushed a commit that referenced this pull request Feb 16, 2026
Fix huge benchmark regression for storage-heavy extrinsics, enabling
jemalloc-allocator via polkadot-jemalloc-shim for omni-bencher, marked
as optional in the scope of PR #10590.

This close paritytech/trie#230.

Thanks @alexggh and @cheme for the help 🙇 

Tested against `runtime / main` and
[2.1.0](polkadot-fellows/runtimes#1065) as
described
[here](paritytech/trie#230 (comment)).
For the `usual` exstrinsic `force_apply_min_commission` doing massive
storage allocation/deallocation on benchmark setup and then just 1read -
2 write in the benchmark extrinsic itself, times goes down from ms to
µs.

The regression was introduced by #10590 `sc-client-db: Make jemalloc
optional`

```bash
runtimes git:(sigurpol-release-2_0_6) /home/paolo/github/polkadot-sdk/target/release/frame-omni-bencher v1 benchmark pallet --runtime ./target/release/wbuild/asset-hub-polkadot-runtime/asset_hub_polkadot_runtime.compact.compressed.wasm --pallet pallet_staking_async --extrinsic "force_apply_min_commission" --steps 2 --repeat 1
2026-02-13T15:06:30.145367Z  INFO frame::benchmark::pallet: Initialized runtime log filter to 'INFO'
2026-02-13T15:06:31.784936Z  INFO pallet_collator_selection::pallet: assembling new collators for new session 0 at #0
2026-02-13T15:06:31.784966Z  INFO pallet_collator_selection::pallet: assembling new collators for new session 1 at #0
2026-02-13T15:08:29.701636Z  INFO frame::benchmark::pallet: [  0 % ] Starting benchmark: pallet_staking_async::force_apply_min_commission
2026-02-13T15:08:35.130403Z  INFO frame::benchmark::pallet: [  0 % ] Running  benchmark: pallet_staking_async::force_apply_min_commission (overtime)
Pallet: "pallet_staking_async", Extrinsic: "force_apply_min_commission", Lowest values: [], Highest values: [], Steps: 2, Repeat: 1
Raw Storage Info
========
Storage: `Staking::MinCommission` (r:1 w:0)
Proof: `Staking::MinCommission` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Storage: `Staking::Validators` (r:1 w:1)
Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.31
              µs

Reads = 2
Writes = 1
Recorded proof Size = 564

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.31
              µs

Reads = 2
Writes = 1
Recorded proof Size = 564
```

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
paritytech-release-backport-bot bot pushed a commit that referenced this pull request Feb 16, 2026
Fix huge benchmark regression for storage-heavy extrinsics, enabling
jemalloc-allocator via polkadot-jemalloc-shim for omni-bencher, marked
as optional in the scope of PR #10590.

This close paritytech/trie#230.

Thanks @alexggh and @cheme for the help 🙇

Tested against `runtime / main` and
[2.1.0](polkadot-fellows/runtimes#1065) as
described
[here](paritytech/trie#230 (comment)).
For the `usual` exstrinsic `force_apply_min_commission` doing massive
storage allocation/deallocation on benchmark setup and then just 1read -
2 write in the benchmark extrinsic itself, times goes down from ms to
µs.

The regression was introduced by #10590 `sc-client-db: Make jemalloc
optional`

```bash
runtimes git:(sigurpol-release-2_0_6) /home/paolo/github/polkadot-sdk/target/release/frame-omni-bencher v1 benchmark pallet --runtime ./target/release/wbuild/asset-hub-polkadot-runtime/asset_hub_polkadot_runtime.compact.compressed.wasm --pallet pallet_staking_async --extrinsic "force_apply_min_commission" --steps 2 --repeat 1
2026-02-13T15:06:30.145367Z  INFO frame::benchmark::pallet: Initialized runtime log filter to 'INFO'
2026-02-13T15:06:31.784936Z  INFO pallet_collator_selection::pallet: assembling new collators for new session 0 at #0
2026-02-13T15:06:31.784966Z  INFO pallet_collator_selection::pallet: assembling new collators for new session 1 at #0
2026-02-13T15:08:29.701636Z  INFO frame::benchmark::pallet: [  0 % ] Starting benchmark: pallet_staking_async::force_apply_min_commission
2026-02-13T15:08:35.130403Z  INFO frame::benchmark::pallet: [  0 % ] Running  benchmark: pallet_staking_async::force_apply_min_commission (overtime)
Pallet: "pallet_staking_async", Extrinsic: "force_apply_min_commission", Lowest values: [], Highest values: [], Steps: 2, Repeat: 1
Raw Storage Info
========
Storage: `Staking::MinCommission` (r:1 w:0)
Proof: `Staking::MinCommission` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
Storage: `Staking::Validators` (r:1 w:1)
Proof: `Staking::Validators` (`max_values`: None, `max_size`: Some(45), added: 2520, mode: `MaxEncodedLen`)

Median Slopes Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.31
              µs

Reads = 2
Writes = 1
Recorded proof Size = 564

Min Squares Analysis
========
-- Extrinsic Time --

Model:
Time ~=    50.31
              µs

Reads = 2
Writes = 1
Recorded proof Size = 564
```

---------

Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
(cherry picked from commit bc42349)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2512 Pull request must be backported to the stable2512 release branch T0-node This PR/Issue is related to the topic “node”.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants