Tier 1 of the post-1.3.0 roadmap. Target version: 1.4.0 (minor).
Every item here is internal. The public API does not move, which is why
this is a minor and not a major.
| # | Item | Measured gain |
|---|
| #82 | Hoist protocol dispatch into module-level tables | 91× / 42× on dispatch |
| #83 | Render MAC addresses with bytes.hex(":") | 16.5× on the call |
| #84 | Stop re-validating addresses the decoder just generated | 2.3 µs/frame |
| #85 | Cache DNS section parsing instead of re-serializing | 14 re-serializations → 1 |
| #86 | Add a reproducible benchmark harness and CI regression gate | — |
The point of this tier
Measured on the 97-frame corpus (CPython 3.12, one machine):
| frames/sec |
|---|
| scapy 2.7.0 | 17,100 |
| NETProtocols 1.3.0 | 36,500 |
| NETProtocols with #82–#84 applied | 89,200 |
| dpkt 1.9.8 | 104,000 |
We are 2.1× faster than scapy and 2.9× slower than dpkt today.
After this tier: ~86% of dpkt and 5.2× scapy. A patched scratch copy
proving the 2.4× end-to-end figure passes all 698 tests unmodified.
Sequencing
#82 and #83 are independent and can land in either order. #84 should
follow them — regex validation only becomes the top remaining cost
once dispatch and MAC rendering are fixed, and measuring it before then
understates it. #85 is independent of all three. #86 closes the tier
and gates any performance claim reaching the README (see #101).
Do not publish numbers before this tier closes
The previous strategy note recommended publishing a benchmark table
immediately. Doing that today would put "2.9× slower than dpkt" in our
own README. Order matters: do the work, then make the claim.
Part of the post-1.3.0 roadmap: #107
Tier 1 of the post-1.3.0 roadmap. Target version: 1.4.0 (minor).
Every item here is internal. The public API does not move, which is why
this is a minor and not a major.
bytes.hex(":")The point of this tier
Measured on the 97-frame corpus (CPython 3.12, one machine):
We are 2.1× faster than scapy and 2.9× slower than dpkt today.
After this tier: ~86% of dpkt and 5.2× scapy. A patched scratch copy
proving the 2.4× end-to-end figure passes all 698 tests unmodified.
Sequencing
#82 and #83 are independent and can land in either order. #84 should
follow them — regex validation only becomes the top remaining cost
once dispatch and MAC rendering are fixed, and measuring it before then
understates it. #85 is independent of all three. #86 closes the tier
and gates any performance claim reaching the README (see #101).
Do not publish numbers before this tier closes
The previous strategy note recommended publishing a benchmark table
immediately. Doing that today would put "2.9× slower than dpkt" in our
own README. Order matters: do the work, then make the claim.
Part of the post-1.3.0 roadmap: #107