You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

60 lines
2.7 KiB

lib Socket Management Performance Benchmark
================================================
=== Socket Management Benchmark ===
Testing with 25 sockets
DEBUG: Socket 0 has fd=6
Created 25 sockets
DEBUG: Total sockets added: 25
Add 25 sockets: 40 us (1.60 us per socket)
SKIPPING POLLING to test corruption
DEBUG: Removing sockets using lookup by FD
DEBUG: Attempting to remove socket 0 (fd=6, id=0x5b50347ee1d0)
DEBUG: Attempting to remove socket 1 (fd=7, id=0x5b50347ee200)
DEBUG: Attempting to remove socket 2 (fd=8, id=0x5b50347ee230)
DEBUG: Attempting to remove socket 3 (fd=9, id=0x5b50347ee260)
DEBUG: Attempting to remove socket 4 (fd=11, id=0x5b50347ee290)
DEBUG: Attempting to remove socket 5 (fd=13, id=0x5b50347ee2c0)
DEBUG: Attempting to remove socket 6 (fd=14, id=0x5b50347ee2f0)
DEBUG: Attempting to remove socket 7 (fd=15, id=0x5b50347ee320)
DEBUG: Attempting to remove socket 8 (fd=16, id=0x5b50347ee350)
DEBUG: Attempting to remove socket 9 (fd=17, id=0x5b50347ee380)
DEBUG: Attempting to remove socket 10 (fd=18, id=0x5b50347ee3b0)
DEBUG: Attempting to remove socket 11 (fd=19, id=0x5b50347ee3e0)
DEBUG: Attempting to remove socket 12 (fd=20, id=0x5b50347ee410)
DEBUG: Attempting to remove socket 13 (fd=21, id=0x5b50347ee440)
DEBUG: Attempting to remove socket 14 (fd=22, id=0x5b50347ee470)
DEBUG: Attempting to remove socket 15 (fd=23, id=0x5b50347ee4a0)
DEBUG: Attempting to remove socket 16 (fd=24, id=0x5b50347ee4d0)
DEBUG: Attempting to remove socket 17 (fd=25, id=0x5b50347ee500)
DEBUG: Attempting to remove socket 18 (fd=26, id=0x5b50347ee530)
DEBUG: Attempting to remove socket 19 (fd=27, id=0x5b50347ee560)
DEBUG: Attempting to remove socket 20 (fd=28, id=0x5b50347ee590)
DEBUG: Attempting to remove socket 21 (fd=29, id=0x5b50347ee5c0)
DEBUG: Attempting to remove socket 22 (fd=30, id=0x5b50347ee5f0)
DEBUG: Attempting to remove socket 23 (fd=31, id=0x5b50347ee620)
DEBUG: Attempting to remove socket 24 (fd=32, id=0x5b50347ee650)
DEBUG: Actually removed 25 sockets, failed 0
Remove 25 sockets: 30 us (1.20 us per socket)
Total time: 70 us
Average per operation: 1.40 us
SKIPPING memory stats for corruption testing
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x5b50347ed2b0
Timer Statistics: allocated=0, freed=0, active=0
Socket Statistics: allocated=25, freed=25, active=0
Active timers in heap: 0
Socket array capacity: 64, active: 0
Total active sockets: 0
🔚 BEFORE_DESTROY: End of resource report
=== Benchmark Complete ===
Array-based socket management provides:
- O(1) add/remove operations (vs O(n) for linked list)
- Better cache locality for sequential socket processing
- Direct FD-to-index mapping for fast lookups
- Reduced memory allocations per operation
PASS test_u_async_performance (exit status: 0)