Allocate only once for the request notifier and multiplexer::elem
- Dominant language
- C++
- Stars
- 282
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
We currently perform one dynamic allocation for the `notifier` and one for the `multiplexer::elem` https://github.com/boostorg/redis/blob/00f3ec9b78454211c7b8d461b11411c8b1ef1ad3/include/boost/redis/connection.hpp#L193-L194
It looks like it is possible to put these two data structures into a single `struct` and allocate only once. As part of the ticket we should also cache these structs to achieve asymptotically zero allocations.
PS1: Do we need to allocate `multiplexer::elem` dynamically at all? These structs are not that big and it looks like they can be also copied. Btw, are there any lower overhead alternatives to `shared_ptr` for single-threaded use?
PS2: Is there any alternative to `std::function` with better small buffer optimization? Most adapters are pretty small data structures.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.