Feature #3216
open
Copy-on-write buffer abstraction and refactor Block
Added by Alex Afanasyev over 9 years ago.
Updated over 7 years ago.
Description
Previously, we had an assumption that every element in the wire format is a TLV or is some other value.
With this assumption, we have created a Block abstraction that implements a copy-on-write buffer with TLV semantics.
However, we don't have implementation of copy-on-write buffer, which created issues when implementing NDNLP.
This a long-term task.
As part of this task we should:
- create copy-on-write buffer abstraction
- refactor Block implementation to use the new abstraction
- if needed, update other parts of encoding
Related issues
2 (2 open — 0 closed)
- Blocks Feature #3217: Avoid memory copy when creating lp::Packet from Fragment added
- Tracker changed from Task to Feature
- Subject changed from Implement a copy-on-write buffer abstraction and refactor Block to copy-on-write buffer abstraction and refactor Block
- Description updated (diff)
What problem has NDNLP implementation encountered without a copy-on-write buffer?
How does a copy-on-write buffer help NDNLP implementation?
During interest/data sending paths:
- construct packet wire (Block)
- ndnlp::Packet::add<Fragment> copies packet wire bytes into NDNLP/Fragment Block
- ndnlp::Packet::wireEncode() copies the whole thing again
With eliminated copy:
- construct packet wire (Block/Buffer)
- ndnlp::Packet::add<Fragment> assign (part of) packet wire as value of NDNLP/Fragment Block's value
- ndnlp::Packet::wireEncode() creates complete wire for the packet
The thirds step is part of a different future optimization.
- Subject changed from copy-on-write buffer abstraction and refactor Block to Copy-on-write buffer abstraction and refactor Block
- Target version deleted (
v0.5)
Also available in: Atom
PDF