A Discrete-Event Network Simulator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Packet Performance

The current implementation of the byte buffers and tag list is based on COW (Copy On Write. An introduction to COW can be found in Scott Meyer's "More Effective C++", items 17 and 29). What this means is that copying packets without modifying them is very cheap (in terms of cpu and memory usage) and modifying them can be also very cheap. What is key for proper COW implementations is being able to detect when a given modification of the state of a packet triggers a full copy of the data prior to the modification: COW systems need to detect when an operation is "dirty".

Dirty operations:

Non-dirty operations:

Dirty operations will always be slower than non-dirty operations, sometimes by several orders of magnitude. However, even the dirty operations have been optimized for common use-cases which means that most of the time, these operations will not trigger data copies and will thus be still very fast.