Skip to content

Conversation

@Dimi1010
Copy link
Collaborator

@Dimi1010 Dimi1010 commented Jan 3, 2026

Optimized the SIP response code parsing to utilize a switch(uint16_t) instead of an unordered_map<std::string, ...>.

Benchmark comparison.

UMap is the original code.
Packed4 uses the pack4 function.
C2UINT16 is the current parseStatusCodePure implementation.

Run on (16 X 4700 MHz CPU s)
CPU Caches:
  L1 Data 48 KiB (x8)
  L1 Instruction 32 KiB (x8)
  L2 Unified 1024 KiB (x8)
  L3 Unified 98304 KiB (x1)
-----------------------------------------------------
Benchmark           Time             CPU   Iterations
-----------------------------------------------------
UMap             15.1 ns         15.0 ns     44800000
Packed4          2.77 ns         2.76 ns    248888889
C2UINT16         2.58 ns         2.62 ns    280000000

@Dimi1010 Dimi1010 marked this pull request as ready for review January 3, 2026 00:52
@Dimi1010 Dimi1010 requested a review from seladb as a code owner January 3, 2026 00:52
@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

❌ Patch coverage is 96.06557% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.46%. Comparing base (5c11564) to head (f52a555).
⚠️ Report is 1 commits behind head on dev.

Files with missing lines Patch % Lines
Packet++/src/SipLayer.cpp 96.38% 6 Missing and 5 partials ⚠️
Packet++/header/SipLayer.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2041      +/-   ##
==========================================
+ Coverage   83.44%   83.46%   +0.01%     
==========================================
  Files         312      312              
  Lines       54741    54850     +109     
  Branches    11847    11819      -28     
==========================================
+ Hits        45681    45781     +100     
+ Misses       8238     7818     -420     
- Partials      822     1251     +429     
Flag Coverage Δ
alpine320 75.96% <92.93%> (+0.09%) ⬆️
fedora42 75.53% <93.44%> (+0.11%) ⬆️
macos-14 81.49% <90.78%> (-0.03%) ⬇️
macos-15 81.48% <90.78%> (-0.03%) ⬇️
mingw32 70.13% <92.17%> (+0.27%) ⬆️
mingw64 70.10% <92.17%> (+0.38%) ⬆️
npcap ?
rhel94 75.41% <56.00%> (-0.03%) ⬇️
ubuntu2004 59.43% <36.00%> (-0.03%) ⬇️
ubuntu2004-zstd 59.53% <36.00%> (-0.03%) ⬇️
ubuntu2204 75.38% <56.00%> (+<0.01%) ⬆️
ubuntu2204-icpx 58.07% <44.23%> (+0.35%) ⬆️
ubuntu2404 75.59% <92.93%> (+0.09%) ⬆️
ubuntu2404-arm64 75.64% <92.93%> (+0.09%) ⬆️
unittest 83.46% <96.06%> (+0.01%) ⬆️
windows-2022 85.40% <94.68%> (+0.18%) ⬆️
windows-2025 85.43% <94.68%> (+0.14%) ⬆️
winpcap 85.43% <94.68%> (-0.06%) ⬇️
xdp 53.00% <56.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dimi1010 Dimi1010 merged commit 50c8430 into seladb:dev Jan 4, 2026
41 checks passed
@Dimi1010 Dimi1010 deleted the refactor/sip-response-code branch January 4, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants