Page MenuHomePhabricator

Add pool based memory resource & allocator
ClosedPublic

Authored by PiRK on May 16 2024, 14:25.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCf93eddc5bfa5: Add pool based memory resource & allocator
Summary

A memory resource similar to std::pmr::unsynchronized_pool_resource, but
optimized for node-based containers.

Co-Authored-By: Pieter Wuille <pieter@wuille.net>

This is a partial backport of core#25325
https://github.com/bitcoin/bitcoin/pull/25325/commits/b8401c3281978beed6198b2f9782b6a8dd35cbd7

with ARM fixes from
https://github.com/bitcoin/bitcoin/pull/28913/commits/ce881bf9fcb7c30bb1fafd6ce38844f4f829452a

Test Plan

ninja all check-all bench-bitcoin

|               ns/op |                op/s |    err% |     total | benchmark
|--------------------:|--------------------:|--------:|----------:|:----------
|               26.04 |       38,408,682.21 |    1.3% |      0.02 | `PoolAllocator_StdUnorderedMap`
|               10.29 |       97,207,783.17 |    0.3% |      0.01 | `PoolAllocator_StdUnorderedMapWithPoolResource`

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable