Code size analysis#

pw_multibuf: A buffer API optimized for zero-copy messaging

The following table shows the code size cost of using pw_multibuf. These size reports compare a fake MultiBuf implementation against the v1 and v2 pw_multibuf implementations, and also compares the two pw_multibuf implementations against each other.

The scenarios being measured involve sending and receiving data using a fake protocol stack. At the lowest layer, “DemoLink” frames carry “DemoNetwork” packets, which in turn carry segments of a “DemoTransport” message. This layered protocol demonstrates how different MultiBuf implementations can handle data encapsulation and fragmentation.

The v0 implementation uses simple, contiguous spans of memory, requiring data to be copied at each protocol layer. In contrast, pw_multibuf is designed to avoid these copies. It allows for reserving space for headers and footers, and can represent data as a collection of discontiguous memory chunks. This reduces memory usage and improves performance by minimizing data movement.

The key difference between pw_multibuf v1 and v2 lies in their approach to memory management. Version 1 integrates memory allocation directly, with a MultiBufAllocator that handles the creation of MultiBuf objects. Version 2 separates memory allocation from the buffer logic, allowing users to provide their own allocation schemes. Additionally, v2 introduces the concept of “layers” to more explicitly manage different views of the data, such as protocol layers.

Label

Segment

Delta

Cost of using MultiBuf v1 vs. a fake implementation

FLASH

+504

[section .rodata]

DEL

-424

pw::multibuf::size_report::ReceiverV0

DEL

-424

pw::multibuf::size_report::SenderV0

+6

pw::multibuf::size_report::Sender<>::DoPend()

+48

pw::multibuf::size_report::Receiver<>::DoPend()

-4

pw::multibuf::size_report::Sender<>::MakeDemoLinkFrame()

+8

pw::multibuf::size_report::TransferMessage()

+32

pw::multibuf::size_report::TransferMessage<>()

-12

pw::multibuf::size_report::Sender<>::MakeDemoTransportSegment()

+52

pw::async2::ReceiveFuture<>::DoPend()

-20

pw::multibuf::size_report::Receiver<>::HandleDemoLinkFrame()

-2

pw::Allocator::DoReallocate()

-4

pw::multibuf::size_report::Sender<>::MakeDemoNetworkPacket()

DEL

-100

pw::multibuf::size_report::FakeMultiBuf::PushBack()

DEL

-98

pw::multibuf::size_report::ReceiverV0::~ReceiverV0()

DEL

-98

pw::multibuf::size_report::SenderV0::~SenderV0()

+40

pw::multibuf::size_report::FrameHandler<>::CalculateChecksum()

+4

pw::multibuf::size_report::Receiver<>::HandleDemoNetworkPacket()

DEL

-92

pw::multibuf::size_report::SenderV0::SenderV0()

DEL

-88

pw::multibuf::size_report::ReceiverV0::ReceiverV0()

DEL

-72

pw::multibuf::size_report::FrameHandlerV0::DoAllocateFrame()

-4

pw::multibuf::size_report::Receiver<>::HandleDemoTransportFirstSegment()

+54

std::__2::__optional_destruct_base<>::~__optional_destruct_base[abi:nqn240000]()

DEL

-60

pw::multibuf::size_report::FakeMultiBuf::set_view()

DEL

-50

pw::multibuf::size_report::FrameHandlerV0::DoPushBack()

+12

vPortSVCHandler_C

+12

pw::containers::internal::GenericDeque<>::pop_front()

+8

pw::multibuf::size_report::Receiver<>::~Receiver()

+2

pw::containers::internal::GenericIntrusiveQueue::remove()

-6

pw::multibuf::size_report::Receiver<>::Receiver<>()

+40

pw::Result<>::operator->()

-8

pw::async2::internal::BaseChannelStorage<>::BaseChannelStorage()

+16

pw::multibuf::size_report::FrameHandler<>::Truncate()

DEL

-40

pw::multibuf::size_report::FrameHandlerV0::DoNarrow()

+12

pw::async2::internal::Channel<>::PopAndWake()

DEL

-36

pw::multibuf::size_report::FrameHandlerV0::DoWiden()

+2

std::__2::__optional_destruct_base<>::reset[abi:nqn240000]()

DEL

-34

memcmp

+4

pw::FixedDeque<>::~FixedDeque()

+20

std::__2::equal[abi:nqn240000]<>()

+2

pw::containers::internal::GenericIntrusiveList<>::insert_after()

DEL

-28

pw::multibuf::size_report::FrameHandlerV0::DoTruncate()

-2

pw::containers::internal::GenericIntrusiveList<>::~GenericIntrusiveList()

+2

pw::containers::internal::GenericDeque<>::EmplaceBackUnchecked<>()

-2

pw::containers::internal::IntrusiveListItemBase<>::~IntrusiveListItemBase()

+2

pw::async2::Waker::~Waker()

DEL

-16

pw::multibuf::size_report::FrameHandlerV0::GetEnd()

DEL

-14

std::__2::__constexpr_memcmp_equal[abi:nqn240000]<>()

+2

__llvm_libc_24_0_0_git::internal::exit()

DEL

-8

pw::multibuf::size_report::FrameHandlerV0::GetBegin()

DEL

-8

pw::multibuf::size_report::FrameHandlerV0::~FrameHandlerV0()

NEW

+424

pw::multibuf::size_report::ReceiverV1

NEW

+424

pw::multibuf::size_report::SenderV1

NEW

+372

xQueueSemaphoreTake

NEW

+336

pw::multibuf::v1::SimpleAllocator::DoAllocate()

NEW

+216

pw::multibuf::v1::SimpleAllocator::DoAllocate()::$_0::operator()()

NEW

+168

pw::multibuf::v1::SimpleAllocator::InternalAllocateContiguous()::$_0::operator()()

NEW

+168

vTaskPriorityDisinheritAfterTimeout

NEW

+162

pw::multibuf::v1::MultiBuf::CopyFromAndOptionallyTruncate()

NEW

+140

xTaskPriorityInherit

NEW

+120

pw::multibuf::v1::SimpleAllocator::InternalAllocateContiguous()

NEW

+120

pw::multibuf::v1::SimpleAllocator::SimpleAllocator()

NEW

+106

pw::multibuf::v1::Chunk::ClaimPrefix()

NEW

+106

pw::multibuf::v1::MultiBuf::CopyTo()

NEW

+104

pw::multibuf::v1::Chunk::Slice()

NEW

+102

pw::multibuf::v1::Chunk::ClaimSuffix()

NEW

+98

pw::multibuf::size_report::ReceiverV1::~ReceiverV1()

NEW

+98

pw::multibuf::size_report::SenderV1::~SenderV1()

NEW

+96

pw::multibuf::v1::MultiBuf::DiscardPrefix()

NEW

+94

pw::multibuf::v1::SimpleAllocator::InsertRegion()

NEW

+92

pw::multibuf::size_report::FrameHandlerV1::DoWiden()

NEW

+90

pw::multibuf::v1::Chunk::Free()

NEW

+90

pw::multibuf::v1::MultiBufAllocator::MoreMemoryAvailable()

NEW

+90

pw::multibuf::v1::SimpleAllocator::GetAvailableMemorySize()

NEW

+84

pw::multibuf::v1::MultiBuf::const_iterator::operator+=()

NEW

+82

pw::containers::internal::GenericDeque<>::contiguous_data()

NEW

+80

pw::Result<>::operator*()

NEW

+80

pw::multibuf::size_report::FrameHandlerV1::DoAllocateFrame()

NEW

+80

pw::multibuf::size_report::SenderV1::SenderV1()

NEW

+80

pw::multibuf::v1::MultiBuf::TruncateAfter()

NEW

+76

pw::multibuf::size_report::ReceiverV1::ReceiverV1()

NEW

+72

vQueueUnregisterQueue

NEW

+70

pw::multibuf::v1::ChunkRegionTracker::CreateFirstChunk()

NEW

+70

pw::multibuf::v1::internal::LinkedRegionTracker::~LinkedRegionTracker()

NEW

+68

std::__2::__equal_impl[abi:nqn240000]<>()

NEW

+66

pw::multibuf::v1::internal::LinkedRegionTracker::Destroy()

NEW

+62

pw::multibuf::v1::MultiBufAllocator::AllocateContiguous()

NEW

+60

pw::sync::Mutex::lock()

NEW

+60

pw::sync::Mutex::unlock()

NEW

+54

pw::multibuf::v1::SimpleAllocator::~SimpleAllocator()

NEW

+52

pw::multibuf::v1::MultiBuf::Truncate()

NEW

+52

pw::multibuf::v1::MultiBufChunks::push_front()

NEW

+52

pw::multibuf::v1::MultiBufChunks::take_front()

NEW

+44

pw::containers::internal::OptionalData<>::AssignState()

NEW

+44

pw::multibuf::size_report::FrameHandlerV1::DoNarrow()

NEW

+40

pw::Result<>::value()

NEW

+40

pw::allocator::BumpAllocator::BumpAllocator()

NEW

+40

pw::multibuf::v1::MultiBuf::const_iterator::operator++()

NEW

+40

vQueueDelete

NEW

+38

pw::multibuf::size_report::Receiver<>::TakeReceived()

NEW

+38

pw::multibuf::v1::MultiBufAllocator::~MultiBufAllocator()

NEW

+36

pw::Deallocator::DeleteArray<>()

NEW

+36

pw::containers::internal::GenericDeque<>::DestroyAll()

NEW

+36

pw::containers::internal::OptionalData<>::OptionalData()

NEW

+36

pw::multibuf::v1::internal::LinkedRegionTracker::LinkedRegionTracker()

NEW

+32

pw::containers::internal::OptionalData<>::Clear()

NEW

+32

pw::containers::internal::OptionalData<>::operator=()

NEW

+32

pw::multibuf::v1::ChunkRegionTracker

NEW

+32

pw::multibuf::v1::MultiBuf::begin()

NEW

+32

pw::multibuf::v1::MultiBufAllocator::MultiBufAllocator()

NEW

+32

pw::multibuf::v1::internal::LinkedRegionTracker

NEW

+28

pw::Allocator::New<>()

NEW

+28

pw::multibuf::v1::ChunkRegionTracker::~ChunkRegionTracker()

NEW

+28

pw::multibuf::v1::MultiBufChunks::PushSuffix()

NEW

+26

pw::multibuf::v1::MultiBuf::ClaimSuffix()

NEW

+24

prvIsQueueEmpty

NEW

+24

pw::containers::internal::OptionalData<>::Assign<>()

NEW

+24

pw::multibuf::size_report::FrameHandlerV1::DoPushBack()

NEW

+24

pw::multibuf::size_report::FrameHandlerV1::DoTruncate()

NEW

+24

pw::multibuf::v1::Chunk::RemoveFromRegionList()

NEW

+24

pw::multibuf::v1::ChunkRegionTracker::ChunkRegionTracker()

NEW

+24

pw::multibuf::v1::MultiBufAllocator

NEW

+24

pw::multibuf::v1::MultiBufChunks::operator=()

NEW

+24

pw::multibuf::v1::SimpleAllocator

NEW

+24

std::__2::__destroy[abi:nqn240000]<>()

NEW

+22

pw::multibuf::v1::MultiBuf::empty()

NEW

+22

pw::multibuf::v1::MultiBufChunks::Release()

NEW

+20

pvTaskIncrementMutexHeldCount

NEW

+20

pw::multibuf::size_report::FrameHandlerV1::GetBegin()

NEW

+20

pw::multibuf::v1::MultiBuf::const_iterator::AdvanceToData()

NEW

+20

pw::multibuf::v1::MultiBufChunks::size_bytes()

NEW

+20

pw::multibuf::v1::OwnedChunk::Release()

NEW

+20

pw::multibuf::v1::internal::LinkedRegionTracker::DeallocateChunkClass()

NEW

+20

std::__2::destroy_n[abi:nqn240000]<>()

NEW

+18

pw::containers::internal::GenericDeque<>::clear()

NEW

+18

pw::containers::internal::LegacyIntrusiveList<>::Item::~Item()

NEW

+18

pw::multibuf::v1::MultiBuf::ClaimPrefix()

NEW

+18

pw::multibuf::v1::internal::LinkedRegionTracker::AllocateChunkClass()

NEW

+16

pw::containers::internal::GenericIntrusiveList<>::clear()

NEW

+16

pw::containers::internal::LegacyIntrusiveList<>::~LegacyIntrusiveList()

NEW

+16

pw::multibuf::size_report::FrameHandlerV1::GetEnd()

NEW

+16

pw::multibuf::v1::MultiBuf::iterator::end()

NEW

+14

pw::multibuf::v1::MultiBuf::const_iterator::end()

NEW

+14

pw::multibuf::v1::SimpleAllocator::DoGetBackingCapacity()

NEW

+12

pw::multibuf::v1::Chunk::DiscardPrefix()

NEW

+12

pw::multibuf::v1::Chunk::Truncate()

NEW

+12

pw::multibuf::v1::MultiBuf::CopyFrom()

NEW

+12

pw::multibuf::v1::MultiBufChunks::back()

NEW

+10

pw::Deallocator::Delete<>()

NEW

+10

pw::multibuf::v1::internal::LinkedRegionTracker::Region()

NEW

+8

pw::multibuf::size_report::FrameHandlerV1::~FrameHandlerV1()

+5,680

RAM

NEW

+1,024

pw::multibuf::size_report::metadata_region

NEW

+80

xQueueRegistry

+1,104

Cost of using MultiBuf v2 vs. a fake implementation

FLASH

+1,280

[section .rodata]

DEL

-424

pw::multibuf::size_report::ReceiverV0

DEL

-424

pw::multibuf::size_report::SenderV0

+6

pw::multibuf::size_report::Sender<>::DoPend()

+30

pw::multibuf::size_report::Receiver<>::DoPend()

-4

pw::multibuf::size_report::Sender<>::MakeDemoLinkFrame()

+28

pw::multibuf::size_report::TransferMessage()

+40

pw::multibuf::size_report::TransferMessage<>()

-12

pw::multibuf::size_report::Sender<>::MakeDemoTransportSegment()

+44

pw::async2::ReceiveFuture<>::DoPend()

-20

pw::multibuf::size_report::Receiver<>::HandleDemoLinkFrame()

-4

pw::multibuf::size_report::Sender<>::MakeDemoNetworkPacket()

DEL

-100

pw::multibuf::size_report::FakeMultiBuf::PushBack()

DEL

-98

pw::multibuf::size_report::ReceiverV0::~ReceiverV0()

DEL

-98

pw::multibuf::size_report::SenderV0::~SenderV0()

+52

pw::multibuf::size_report::FrameHandler<>::CalculateChecksum()

+4

pw::multibuf::size_report::Receiver<>::HandleDemoNetworkPacket()

DEL

-92

pw::multibuf::size_report::SenderV0::SenderV0()

DEL

-88

pw::multibuf::size_report::ReceiverV0::ReceiverV0()

+72

pw::SharedPtr<>::reset()

+2

pw::GetAlignedSubspan()

DEL

-72

pw::multibuf::size_report::FrameHandlerV0::DoAllocateFrame()

-4

pw::multibuf::size_report::Receiver<>::HandleDemoTransportFirstSegment()

+28

std::__2::__optional_destruct_base<>::~__optional_destruct_base[abi:nqn240000]()

DEL

-60

pw::multibuf::size_report::FakeMultiBuf::set_view()

DEL

-50

pw::multibuf::size_report::FrameHandlerV0::DoPushBack()

+48

pw::containers::internal::GenericDeque<>::front()

+56

pw::containers::internal::GenericDeque<>::pop_front()

+8

pw::multibuf::size_report::Receiver<>::~Receiver()

+10

pw::multibuf::size_report::Receiver<>::Receiver<>()

+16

pw::multibuf::size_report::FrameHandler<>::Truncate()

DEL

-40

pw::multibuf::size_report::FrameHandlerV0::DoNarrow()

-2

pw::async2::internal::BaseChannel::RemoveRefAndDestroyIfUnreferenced()

+22

pw::async2::internal::Channel<>::PopAndWake()

+60

pw::containers::internal::GenericDeque<>::try_emplace_back<>()

DEL

-36

pw::multibuf::size_report::FrameHandlerV0::DoWiden()

+2

std::__2::__optional_destruct_base<>::reset[abi:nqn240000]()

DEL

-34

memcmp

+4

pw::FixedDeque<>::~FixedDeque()

+74

std::__2::equal[abi:nqn240000]<>()

+4

__aeabi_dcmpun

DEL

-28

pw::multibuf::size_report::FrameHandlerV0::DoTruncate()

+12

std::__2::__optional_storage_base<>::__construct[abi:nqn240000]<>()

+46

pw::containers::internal::GenericDeque<>::EmplaceBackUnchecked<>()

DEL

-16

pw::multibuf::size_report::FrameHandlerV0::GetEnd()

DEL

-14

std::__2::__constexpr_memcmp_equal[abi:nqn240000]<>()

+4

__bi_84

+2

__llvm_libc_24_0_0_git::internal::exit()

+2

pw::allocator::AbstractAllocator::DoMeasureFragmentation()

DEL

-8

pw::multibuf::size_report::FrameHandlerV0::GetBegin()

DEL

-8

pw::multibuf::size_report::FrameHandlerV0::~FrameHandlerV0()

-2

pw::multibuf::size_report::FrameHandler<>::~FrameHandler()

NEW

+716

pw::multibuf::v2::internal::GenericMultiBuf::Insert()

NEW

+484

pw::multibuf::v2::internal::GenericMultiBuf::AddLayer()

NEW

+424

pw::multibuf::size_report::ReceiverV2

NEW

+424

pw::multibuf::size_report::SenderV2

NEW

+272

pw::multibuf::v2::internal::GenericMultiBuf::PopLayer()

NEW

+260

pw::multibuf::v2::internal::GenericMultiBuf::InsertChunks()

NEW

+238

std::__2::__cxx_atomic_compare_exchange_weak[abi:nqn240000]<>()

NEW

+204

pw::multibuf::v2::internal::GenericMultiBuf::TruncateTopLayer()

NEW

+192

pw::multibuf::v2::internal::GenericMultiBuf::SplitAfter()

NEW

+180

pw::multibuf::v2::internal::GenericMultiBuf::TryReserveForInsert()

NEW

+166

pw::containers::internal::GenericDeque<>::contiguous_data()

NEW

+158

pw::multibuf::v2::internal::GenericMultiBuf::EraseRange()

NEW

+156

pw::containers::internal::GenericDeque<>::erase()

NEW

+156

pw::multibuf::v2::internal::GenericMultiBuf::ClearRange()

NEW

+148

pw::multibuf::v2::internal::GenericMultiBuf::SplitBase()

NEW

+148

pw::multibuf::v2::internal::operator-()

NEW

+144

pw::multibuf::v2::internal::BasicByteIterator::Increment()

NEW

+144

pw::multibuf::v2::internal::GenericMultiBuf::SplitBefore()

NEW

+136

pw::allocator::ChunkPool::ChunkPool()

NEW

+132

pw::multibuf::size_report::FrameHandlerV2::DoAllocateFrame()

NEW

+126

pw::DynamicDeque<>::ReallocateBuffer()

NEW

+120

pw::containers::internal::GenericDeque<>::operator[]()

NEW

+120

pw::multibuf::v2::internal::BasicByteIterator::Decrement()

NEW

+108

std::__2::__copy_move_unwrap_iters[abi:nqn240000]<>()

NEW

+104

pw::multibuf::v2::internal::CheckedCast<>()

NEW

+104

pw::multibuf::v2::internal::GenericMultiBuf::CopyToImpl()

NEW

+104

pw::multibuf::v2::internal::GenericMultiBuf::TryConvertToShared()

NEW

+102

pw::multibuf::v2::internal::GenericMultiBuf::CopyFrom()

NEW

+100

pw::multibuf::v2::internal::GenericMultiBuf::UnsealTopLayer()

NEW

+100

std::__2::__move_backward_impl<>::operator()[abi:nqn240000]<>()

NEW

+100

std::__2::__move_impl<>::operator()[abi:nqn240000]<>()

NEW

+98

pw::multibuf::size_report::ReceiverV2::~ReceiverV2()

NEW

+98

pw::multibuf::size_report::SenderV2::~SenderV2()

NEW

+96

pw::multibuf::size_report::ReceiverV2::ReceiverV2()

NEW

+96

pw::multibuf::size_report::SenderV2::SenderV2()

NEW

+92

pw::multibuf::v2::internal::GenericMultiBuf::Clear()

NEW

+88

pw::allocator::internal::ControlBlock::IncrementShared()

NEW

+82

pw::allocator::ChunkPool::DoGetInfo()

NEW

+80

pw::containers::internal::GenericDeque<>::push_back()

NEW

+80

pw::multibuf::v2::internal::GenericMultiBuf::TryReserveEntries()

NEW

+78

pw::multibuf::v2::internal::Entry::GetView()

NEW

+76

pw::DynamicDeque<>::try_reserve()

NEW

+74

pw::multibuf::v2::internal::BasicByteIterator::Compare()

NEW

+72

pw::allocator::Pool::NewArray<>()

NEW

+72

pw::allocator::internal::ControlBlock::ControlBlock()

NEW

+68

__atomic_compare_exchange_4

NEW

+68

pw::DynamicDeque<>::IncreaseCapacity()

NEW

+68

std::__2::__equal_iter_impl[abi:nqn240000]<>()

NEW

+60

pw::multibuf::size_report::FrameHandlerV2::DoNarrow()

NEW

+56

pw::multibuf::v2::internal::ByteIterator<>::operator*()

NEW

+56

pw::multibuf::v2::internal::Entry::GetControlBlock()

NEW

+56

pw::multibuf::v2::internal::Entry::GetDeallocator()

NEW

+52

pw::allocator::Hardening::Multiply<>()

NEW

+52

pw::allocator::internal::ControlBlock::Create()

NEW

+52

pw::containers::internal::GenericDequeBase<>::AbsoluteIndexChecked()

NEW

+50

pw::multibuf::size_report::FrameHandlerV2::DoWiden()

NEW

+50

pw::multibuf::v2::BasicMultiBuf<>::PushBack()

NEW

+48

pw::multibuf::size_report::Receiver<>::TakeReceived()

NEW

+48

pw::multibuf::v2::BasicMultiBuf<>::PushBack<>()

NEW

+48

pw::multibuf::v2::internal::Entry::GetLength()

NEW

+48

pw::multibuf::v2::internal::Entry::GetOffset()

NEW

+46

pw::multibuf::v2::internal::operator+<>()

NEW

+44

pw::DynamicDeque<>::operator=()

NEW

+42

pw::multibuf::v2::internal::Entry::IsBoundary()

NEW

+40

pw::Result<>::value()

NEW

+40

pw::allocator::Layout::Of<>()

NEW

+38

pw::containers::internal::GenericDeque<>::DestroyAll()

NEW

+38

pw::multibuf::v2::internal::ByteIterator<>::operator ?<>()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::cend()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::operator=()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::size()

NEW

+36

pw::multibuf::v2::internal::BasicByteIterator::deque()

NEW

+36

std::__2::move[abi:nqn240000]<>()

NEW

+36

std::__2::move_backward[abi:nqn240000]<>()

NEW

+34

pw::UniquePtr<>::operator=<>()

NEW

+32

__atomic_load_4

NEW

+32

pw::multibuf::v2::internal::GenericMultiBuf::GenericMultiBuf()

NEW

+30

pw::multibuf::v2::internal::Entry::IsSealed()

NEW

+28

pw::UniquePtr<>::Reset()

NEW

+28

pw::allocator::ChunkPool

NEW

+28

pw::allocator::Pool

NEW

+28

pw::containers::internal::GenericDequeBase<>::MoveAssignIndices()

NEW

+28

pw::multibuf::v2::internal::ByteIterator<>::operator++()

NEW

+28

pw::multibuf::v2::internal::GenericMultiBuf::end()

NEW

+26

pw::multibuf::v2::internal::GenericMultiBuf::cbegin()

NEW

+26

std::__2::optional<>::optional[abi:nqn240000]<>()

NEW

+24

pw::multibuf::size_report::FrameHandlerV2::DoPushBack()

NEW

+24

pw::multibuf::size_report::FrameHandlerV2::DoTruncate()

NEW

+24

pw::multibuf::v2::internal::operator!=()

NEW

+22

pw::DynamicDeque<>::~DynamicDeque()

NEW

+22

pw::allocator::Pool::MakeUnique<>()

NEW

+22

pw::containers::internal::GenericDeque<>::CheckCapacityAdd()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::GetLength()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::GetOffset()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::IsBoundary()

NEW

+20

pw::UniquePtr<>::UniquePtr<>()

NEW

+20

pw::multibuf::size_report::FrameHandlerV2::GetBegin()

NEW

+20

pw::multibuf::size_report::FrameHandlerV2::GetEnd()

NEW

+20

pw::multibuf::v2::internal::Entry::IsShared()

NEW

+20

std::__2::__destroy[abi:nqn240000]<>()

NEW

+20

std::__2::__optional_move_base<>::__optional_move_base[abi:nqn240000]()

NEW

+18

pw::DynamicDeque<>::try_reserve_exact()

NEW

+18

pw::containers::internal::GenericDeque<>::clear()

NEW

+18

pw::multibuf::v2::internal::Entry::IsOwned()

NEW

+18

pw::multibuf::v2::internal::GenericMultiBuf::MakeIterator()

NEW

+16

__aeabi_idivmod

NEW

+16

pw::multibuf::v2::internal::Entry::GetData()

NEW

+16

pw::multibuf::v2::internal::GenericMultiBuf::~GenericMultiBuf()

NEW

+14

pw::allocator::ChunkPool::DoAllocate()

NEW

+14

pw::containers::internal::GenericDeque<>::at()

NEW

+14

pw::multibuf::v2::internal::GenericMultiBuf::begin()

NEW

+14

std::__2::__optional_storage_base<>::__construct_from[abi:nqn240000]<>()

NEW

+12

pw::allocator::ChunkPool::DoDeallocate()

NEW

+12

pw::containers::internal::DequeIterator<>::operator*()

NEW

+12

pw::multibuf::v2::internal::ByteIterator<>::operator+=<>()

NEW

+12

pw::multibuf::v2::internal::GenericMultiBuf::CopyTo()

NEW

+12

pw::multibuf::v2::internal::GenericMultiBuf::IsOwned()

NEW

+12

std::__2::__atomic_base<>::compare_exchange_weak[abi:nqn240000]()

NEW

+10

pw::allocator::ChunkPool::~ChunkPool()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetControlBlock()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetData()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetDeallocator()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetView()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::IsSealed()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::IsShared()

NEW

+8

pw::allocator::internal::ControlBlockHandle::GetInstance_DO_NOT_USE()

NEW

+8

pw::multibuf::size_report::FrameHandlerV2::kLayout

NEW

+8

pw::multibuf::size_report::FrameHandlerV2::~FrameHandlerV2()

NEW

+6

pw::Deallocator::DoGetInfo()

NEW

+4

pw::allocator::internal::ControlBlockHandle::GetInstance_DO_NOT_USE()::kControlBlockHandle

NEW

+2

pw::Deallocator::~Deallocator()

NEW

+2

pw::allocator::Pool::~Pool()

+9,888

RAM

NEW

+1,024

pw::multibuf::size_report::metadata_region

+1,024

Cost of using MultiBuf v2 vs. v1

FLASH

+776

[section .rodata]

DEL

-424

pw::multibuf::size_report::ReceiverV1

DEL

-424

pw::multibuf::size_report::SenderV1

DEL

-372

xQueueSemaphoreTake

DEL

-336

pw::multibuf::v1::SimpleAllocator::DoAllocate()

-18

pw::multibuf::size_report::Receiver<>::DoPend()

DEL

-216

pw::multibuf::v1::SimpleAllocator::DoAllocate()::$_0::operator()()

-8

pw::async2::ReceiveFuture<>::DoPend()

+8

pw::multibuf::size_report::TransferMessage<>()

DEL

-168

pw::multibuf::v1::SimpleAllocator::InternalAllocateContiguous()::$_0::operator()()

DEL

-168

vTaskPriorityDisinheritAfterTimeout

DEL

-162

pw::multibuf::v1::MultiBuf::CopyFromAndOptionallyTruncate()

+20

pw::multibuf::size_report::TransferMessage()

DEL

-140

xTaskPriorityInherit

+12

pw::multibuf::size_report::FrameHandler<>::CalculateChecksum()

DEL

-120

pw::multibuf::v1::SimpleAllocator::InternalAllocateContiguous()

DEL

-120

pw::multibuf::v1::SimpleAllocator::SimpleAllocator()

-26

std::__2::__optional_destruct_base<>::~__optional_destruct_base[abi:nqn240000]()

+2

pw::Allocator::DoReallocate()

DEL

-106

pw::multibuf::v1::Chunk::ClaimPrefix()

DEL

-106

pw::multibuf::v1::MultiBuf::CopyTo()

DEL

-104

pw::multibuf::v1::Chunk::Slice()

DEL

-102

pw::multibuf::v1::Chunk::ClaimSuffix()

DEL

-98

pw::multibuf::size_report::ReceiverV1::~ReceiverV1()

DEL

-98

pw::multibuf::size_report::SenderV1::~SenderV1()

DEL

-96

pw::multibuf::v1::MultiBuf::DiscardPrefix()

DEL

-94

pw::multibuf::v1::SimpleAllocator::InsertRegion()

DEL

-92

pw::multibuf::size_report::FrameHandlerV1::DoWiden()

DEL

-90

pw::multibuf::v1::Chunk::Free()

DEL

-90

pw::multibuf::v1::MultiBufAllocator::MoreMemoryAvailable()

DEL

-90

pw::multibuf::v1::SimpleAllocator::GetAvailableMemorySize()

+72

pw::SharedPtr<>::reset()

DEL

-84

pw::multibuf::v1::MultiBuf::const_iterator::operator+=()

+84

pw::containers::internal::GenericDeque<>::contiguous_data()

DEL

-80

pw::Result<>::operator*()

-40

pw::Result<>::operator->()

DEL

-80

pw::multibuf::size_report::FrameHandlerV1::DoAllocateFrame()

DEL

-80

pw::multibuf::size_report::SenderV1::SenderV1()

DEL

-80

pw::multibuf::v1::MultiBuf::TruncateAfter()

DEL

-76

pw::multibuf::size_report::ReceiverV1::ReceiverV1()

+2

pw::GetAlignedSubspan()

DEL

-72

vQueueUnregisterQueue

DEL

-70

pw::multibuf::v1::ChunkRegionTracker::CreateFirstChunk()

DEL

-70

pw::multibuf::v1::internal::LinkedRegionTracker::~LinkedRegionTracker()

DEL

-68

std::__2::__equal_impl[abi:nqn240000]<>()

DEL

-66

pw::multibuf::v1::internal::LinkedRegionTracker::Destroy()

DEL

-62

pw::multibuf::v1::MultiBufAllocator::AllocateContiguous()

DEL

-60

pw::sync::Mutex::lock()

DEL

-60

pw::sync::Mutex::unlock()

-12

vPortSVCHandler_C

+44

pw::containers::internal::GenericDeque<>::pop_front()

DEL

-54

pw::multibuf::v1::SimpleAllocator::~SimpleAllocator()

DEL

-52

pw::multibuf::v1::MultiBuf::Truncate()

DEL

-52

pw::multibuf::v1::MultiBufChunks::push_front()

DEL

-52

pw::multibuf::v1::MultiBufChunks::take_front()

+54

std::__2::equal[abi:nqn240000]<>()

+10

pw::async2::internal::Channel<>::PopAndWake()

+48

pw::containers::internal::GenericDeque<>::front()

-2

pw::containers::internal::GenericIntrusiveQueue::remove()

DEL

-44

pw::containers::internal::OptionalData<>::AssignState()

DEL

-44

pw::multibuf::size_report::FrameHandlerV1::DoNarrow()

DEL

-40

pw::allocator::BumpAllocator::BumpAllocator()

DEL

-40

pw::multibuf::v1::MultiBuf::const_iterator::operator++()

DEL

-40

vQueueDelete

+10

pw::multibuf::size_report::Receiver<>::TakeReceived()

DEL

-38

pw::multibuf::v1::MultiBufAllocator::~MultiBufAllocator()

DEL

-36

pw::Deallocator::DeleteArray<>()

-2

pw::async2::internal::BaseChannel::RemoveRefAndDestroyIfUnreferenced()

+2

pw::containers::internal::GenericDeque<>::DestroyAll()

+60

pw::containers::internal::GenericDeque<>::try_emplace_back<>()

DEL

-36

pw::containers::internal::OptionalData<>::OptionalData()

+16

pw::multibuf::size_report::Receiver<>::Receiver<>()

DEL

-36

pw::multibuf::v1::internal::LinkedRegionTracker::LinkedRegionTracker()

+8

pw::async2::internal::BaseChannelStorage<>::BaseChannelStorage()

DEL

-32

pw::containers::internal::OptionalData<>::Clear()

DEL

-32

pw::containers::internal::OptionalData<>::operator=()

DEL

-32

pw::multibuf::v1::ChunkRegionTracker

DEL

-32

pw::multibuf::v1::MultiBuf::begin()

DEL

-32

pw::multibuf::v1::MultiBufAllocator::MultiBufAllocator()

DEL

-32

pw::multibuf::v1::internal::LinkedRegionTracker

-2

pw::containers::internal::GenericIntrusiveList<>::insert_after()

+4

__aeabi_dcmpun

DEL

-28

pw::Allocator::New<>()

DEL

-28

pw::multibuf::v1::ChunkRegionTracker::~ChunkRegionTracker()

DEL

-28

pw::multibuf::v1::MultiBufChunks::PushSuffix()

DEL

-26

pw::multibuf::v1::MultiBuf::ClaimSuffix()

DEL

-24

prvIsQueueEmpty

+44

pw::containers::internal::GenericDeque<>::EmplaceBackUnchecked<>()

+2

pw::containers::internal::GenericIntrusiveList<>::~GenericIntrusiveList()

DEL

-24

pw::containers::internal::OptionalData<>::Assign<>()

DEL

-24

pw::multibuf::size_report::FrameHandlerV1::DoPushBack()

DEL

-24

pw::multibuf::size_report::FrameHandlerV1::DoTruncate()

DEL

-24

pw::multibuf::v1::Chunk::RemoveFromRegionList()

DEL

-24

pw::multibuf::v1::ChunkRegionTracker::ChunkRegionTracker()

DEL

-24

pw::multibuf::v1::MultiBufAllocator

DEL

-24

pw::multibuf::v1::MultiBufChunks::operator=()

DEL

-24

pw::multibuf::v1::SimpleAllocator

-4

std::__2::__destroy[abi:nqn240000]<>()

+12

std::__2::__optional_storage_base<>::__construct[abi:nqn240000]<>()

DEL

-22

pw::multibuf::v1::MultiBuf::empty()

DEL

-22

pw::multibuf::v1::MultiBufChunks::Release()

DEL

-20

pvTaskIncrementMutexHeldCount

+2

pw::containers::internal::IntrusiveListItemBase<>::~IntrusiveListItemBase()

DEL

-20

pw::multibuf::size_report::FrameHandlerV1::GetBegin()

DEL

-20

pw::multibuf::v1::MultiBuf::const_iterator::AdvanceToData()

DEL

-20

pw::multibuf::v1::MultiBufChunks::size_bytes()

DEL

-20

pw::multibuf::v1::OwnedChunk::Release()

DEL

-20

pw::multibuf::v1::internal::LinkedRegionTracker::DeallocateChunkClass()

DEL

-20

std::__2::destroy_n[abi:nqn240000]<>()

-2

pw::async2::Waker::~Waker()

DEL

-18

pw::containers::internal::LegacyIntrusiveList<>::Item::~Item()

DEL

-18

pw::multibuf::v1::MultiBuf::ClaimPrefix()

DEL

-18

pw::multibuf::v1::internal::LinkedRegionTracker::AllocateChunkClass()

DEL

-16

pw::containers::internal::GenericIntrusiveList<>::clear()

DEL

-16

pw::containers::internal::LegacyIntrusiveList<>::~LegacyIntrusiveList()

DEL

-16

pw::multibuf::size_report::FrameHandlerV1::GetEnd()

DEL

-16

pw::multibuf::v1::MultiBuf::iterator::end()

DEL

-14

pw::multibuf::v1::MultiBuf::const_iterator::end()

DEL

-14

pw::multibuf::v1::SimpleAllocator::DoGetBackingCapacity()

+4

__bi_84

DEL

-12

pw::multibuf::v1::Chunk::DiscardPrefix()

DEL

-12

pw::multibuf::v1::Chunk::Truncate()

DEL

-12

pw::multibuf::v1::MultiBuf::CopyFrom()

DEL

-12

pw::multibuf::v1::MultiBufChunks::back()

DEL

-10

pw::Deallocator::Delete<>()

DEL

-10

pw::multibuf::v1::internal::LinkedRegionTracker::Region()

+2

pw::allocator::AbstractAllocator::DoMeasureFragmentation()

DEL

-8

pw::multibuf::size_report::FrameHandlerV1::~FrameHandlerV1()

-2

pw::multibuf::size_report::FrameHandler<>::~FrameHandler()

NEW

+716

pw::multibuf::v2::internal::GenericMultiBuf::Insert()

NEW

+484

pw::multibuf::v2::internal::GenericMultiBuf::AddLayer()

NEW

+424

pw::multibuf::size_report::ReceiverV2

NEW

+424

pw::multibuf::size_report::SenderV2

NEW

+272

pw::multibuf::v2::internal::GenericMultiBuf::PopLayer()

NEW

+260

pw::multibuf::v2::internal::GenericMultiBuf::InsertChunks()

NEW

+238

std::__2::__cxx_atomic_compare_exchange_weak[abi:nqn240000]<>()

NEW

+204

pw::multibuf::v2::internal::GenericMultiBuf::TruncateTopLayer()

NEW

+192

pw::multibuf::v2::internal::GenericMultiBuf::SplitAfter()

NEW

+180

pw::multibuf::v2::internal::GenericMultiBuf::TryReserveForInsert()

NEW

+158

pw::multibuf::v2::internal::GenericMultiBuf::EraseRange()

NEW

+156

pw::containers::internal::GenericDeque<>::erase()

NEW

+156

pw::multibuf::v2::internal::GenericMultiBuf::ClearRange()

NEW

+148

pw::multibuf::v2::internal::GenericMultiBuf::SplitBase()

NEW

+148

pw::multibuf::v2::internal::operator-()

NEW

+144

pw::multibuf::v2::internal::BasicByteIterator::Increment()

NEW

+144

pw::multibuf::v2::internal::GenericMultiBuf::SplitBefore()

NEW

+136

pw::allocator::ChunkPool::ChunkPool()

NEW

+132

pw::multibuf::size_report::FrameHandlerV2::DoAllocateFrame()

NEW

+126

pw::DynamicDeque<>::ReallocateBuffer()

NEW

+120

pw::containers::internal::GenericDeque<>::operator[]()

NEW

+120

pw::multibuf::v2::internal::BasicByteIterator::Decrement()

NEW

+108

std::__2::__copy_move_unwrap_iters[abi:nqn240000]<>()

NEW

+104

pw::multibuf::v2::internal::CheckedCast<>()

NEW

+104

pw::multibuf::v2::internal::GenericMultiBuf::CopyToImpl()

NEW

+104

pw::multibuf::v2::internal::GenericMultiBuf::TryConvertToShared()

NEW

+102

pw::multibuf::v2::internal::GenericMultiBuf::CopyFrom()

NEW

+100

pw::multibuf::v2::internal::GenericMultiBuf::UnsealTopLayer()

NEW

+100

std::__2::__move_backward_impl<>::operator()[abi:nqn240000]<>()

NEW

+100

std::__2::__move_impl<>::operator()[abi:nqn240000]<>()

NEW

+98

pw::multibuf::size_report::ReceiverV2::~ReceiverV2()

NEW

+98

pw::multibuf::size_report::SenderV2::~SenderV2()

NEW

+96

pw::multibuf::size_report::ReceiverV2::ReceiverV2()

NEW

+96

pw::multibuf::size_report::SenderV2::SenderV2()

NEW

+92

pw::multibuf::v2::internal::GenericMultiBuf::Clear()

NEW

+88

pw::allocator::internal::ControlBlock::IncrementShared()

NEW

+82

pw::allocator::ChunkPool::DoGetInfo()

NEW

+80

pw::containers::internal::GenericDeque<>::push_back()

NEW

+80

pw::multibuf::v2::internal::GenericMultiBuf::TryReserveEntries()

NEW

+78

pw::multibuf::v2::internal::Entry::GetView()

NEW

+76

pw::DynamicDeque<>::try_reserve()

NEW

+74

pw::multibuf::v2::internal::BasicByteIterator::Compare()

NEW

+72

pw::allocator::Pool::NewArray<>()

NEW

+72

pw::allocator::internal::ControlBlock::ControlBlock()

NEW

+68

__atomic_compare_exchange_4

NEW

+68

pw::DynamicDeque<>::IncreaseCapacity()

NEW

+68

std::__2::__equal_iter_impl[abi:nqn240000]<>()

NEW

+60

pw::multibuf::size_report::FrameHandlerV2::DoNarrow()

NEW

+56

pw::multibuf::v2::internal::ByteIterator<>::operator*()

NEW

+56

pw::multibuf::v2::internal::Entry::GetControlBlock()

NEW

+56

pw::multibuf::v2::internal::Entry::GetDeallocator()

NEW

+52

pw::allocator::Hardening::Multiply<>()

NEW

+52

pw::allocator::internal::ControlBlock::Create()

NEW

+52

pw::containers::internal::GenericDequeBase<>::AbsoluteIndexChecked()

NEW

+50

pw::multibuf::size_report::FrameHandlerV2::DoWiden()

NEW

+50

pw::multibuf::v2::BasicMultiBuf<>::PushBack()

NEW

+48

pw::multibuf::v2::BasicMultiBuf<>::PushBack<>()

NEW

+48

pw::multibuf::v2::internal::Entry::GetLength()

NEW

+48

pw::multibuf::v2::internal::Entry::GetOffset()

NEW

+46

pw::multibuf::v2::internal::operator+<>()

NEW

+44

pw::DynamicDeque<>::operator=()

NEW

+42

pw::multibuf::v2::internal::Entry::IsBoundary()

NEW

+40

pw::allocator::Layout::Of<>()

NEW

+38

pw::multibuf::v2::internal::ByteIterator<>::operator ?<>()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::cend()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::operator=()

NEW

+38

pw::multibuf::v2::internal::GenericMultiBuf::size()

NEW

+36

pw::multibuf::v2::internal::BasicByteIterator::deque()

NEW

+36

std::__2::move[abi:nqn240000]<>()

NEW

+36

std::__2::move_backward[abi:nqn240000]<>()

NEW

+34

pw::UniquePtr<>::operator=<>()

NEW

+32

__atomic_load_4

NEW

+32

pw::multibuf::v2::internal::GenericMultiBuf::GenericMultiBuf()

NEW

+30

pw::multibuf::v2::internal::Entry::IsSealed()

NEW

+28

pw::UniquePtr<>::Reset()

NEW

+28

pw::allocator::ChunkPool

NEW

+28

pw::allocator::Pool

NEW

+28

pw::containers::internal::GenericDequeBase<>::MoveAssignIndices()

NEW

+28

pw::multibuf::v2::internal::ByteIterator<>::operator++()

NEW

+28

pw::multibuf::v2::internal::GenericMultiBuf::end()

NEW

+26

pw::multibuf::v2::internal::GenericMultiBuf::cbegin()

NEW

+26

std::__2::optional<>::optional[abi:nqn240000]<>()

NEW

+24

pw::multibuf::size_report::FrameHandlerV2::DoPushBack()

NEW

+24

pw::multibuf::size_report::FrameHandlerV2::DoTruncate()

NEW

+24

pw::multibuf::v2::internal::operator!=()

NEW

+22

pw::DynamicDeque<>::~DynamicDeque()

NEW

+22

pw::allocator::Pool::MakeUnique<>()

NEW

+22

pw::containers::internal::GenericDeque<>::CheckCapacityAdd()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::GetLength()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::GetOffset()

NEW

+22

pw::multibuf::v2::internal::GenericMultiBuf::IsBoundary()

NEW

+20

pw::UniquePtr<>::UniquePtr<>()

NEW

+20

pw::multibuf::size_report::FrameHandlerV2::GetBegin()

NEW

+20

pw::multibuf::size_report::FrameHandlerV2::GetEnd()

NEW

+20

pw::multibuf::v2::internal::Entry::IsShared()

NEW

+20

std::__2::__optional_move_base<>::__optional_move_base[abi:nqn240000]()

NEW

+18

pw::DynamicDeque<>::try_reserve_exact()

NEW

+18

pw::multibuf::v2::internal::Entry::IsOwned()

NEW

+18

pw::multibuf::v2::internal::GenericMultiBuf::MakeIterator()

NEW

+16

__aeabi_idivmod

NEW

+16

pw::multibuf::v2::internal::Entry::GetData()

NEW

+16

pw::multibuf::v2::internal::GenericMultiBuf::~GenericMultiBuf()

NEW

+14

pw::allocator::ChunkPool::DoAllocate()

NEW

+14

pw::containers::internal::GenericDeque<>::at()

NEW

+14

pw::multibuf::v2::internal::GenericMultiBuf::begin()

NEW

+14

std::__2::__optional_storage_base<>::__construct_from[abi:nqn240000]<>()

NEW

+12

pw::allocator::ChunkPool::DoDeallocate()

NEW

+12

pw::containers::internal::DequeIterator<>::operator*()

NEW

+12

pw::multibuf::v2::internal::ByteIterator<>::operator+=<>()

NEW

+12

pw::multibuf::v2::internal::GenericMultiBuf::CopyTo()

NEW

+12

pw::multibuf::v2::internal::GenericMultiBuf::IsOwned()

NEW

+12

std::__2::__atomic_base<>::compare_exchange_weak[abi:nqn240000]()

NEW

+10

pw::allocator::ChunkPool::~ChunkPool()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetControlBlock()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetData()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetDeallocator()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::GetView()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::IsSealed()

NEW

+10

pw::multibuf::v2::internal::GenericMultiBuf::IsShared()

NEW

+8

pw::allocator::internal::ControlBlockHandle::GetInstance_DO_NOT_USE()

NEW

+8

pw::multibuf::size_report::FrameHandlerV2::kLayout

NEW

+8

pw::multibuf::size_report::FrameHandlerV2::~FrameHandlerV2()

NEW

+6

pw::Deallocator::DoGetInfo()

NEW

+4

pw::allocator::internal::ControlBlockHandle::GetInstance_DO_NOT_USE()::kControlBlockHandle

NEW

+2

pw::Deallocator::~Deallocator()

NEW

+2

pw::allocator::Pool::~Pool()

+4,208

RAM

DEL

-80

xQueueRegistry

-80