Skip to content

Add a dynamic buffer type with stack storage optimization #19

@BurningEnlightenment

Description

@BurningEnlightenment

Problem Description

For efficient de-/serialization one needs the data to be stored in contiguous memory.

Proposed Solution

A type which can act as a dynamically resizable output range.

Possible Alternative Approaches

The standard library provides std::vector and std::array. While the former fits our requirements semantically it always heap allocates and initializes the storage which kills the performance for small inputs/large outputs respectively. The latter doesn't support dynamic resizing.

boost provides boost::container::small_vector<> and boost::container::static_vector<> which can be used, but carry quite the dependency chain. Also note that these are more general and can accomodate types which don't satisfy std::is_trivially_copyable. Sadly this drags in a lot of extra machinery sometimes inhibiting the optimizer.

Additional Context

Metadata

Metadata

Labels

type:taskA atomic feature / thing to be implemented

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions