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.
 
 
 
 
 
 

59 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: 26 us (1.04 us per socket)
SKIPPING POLLING to test corruption
DEBUG: Removing sockets using lookup by FD
DEBUG: Attempting to remove socket 0 (fd=6, id=0x575a04a9bb90)
DEBUG: Attempting to remove socket 1 (fd=7, id=0x575a04a9bbd8)
DEBUG: Attempting to remove socket 2 (fd=8, id=0x575a04a9bc20)
DEBUG: Attempting to remove socket 3 (fd=9, id=0x575a04a9bc68)
DEBUG: Attempting to remove socket 4 (fd=10, id=0x575a04a9bcb0)
DEBUG: Attempting to remove socket 5 (fd=11, id=0x575a04a9bcf8)
DEBUG: Attempting to remove socket 6 (fd=12, id=0x575a04a9bd40)
DEBUG: Attempting to remove socket 7 (fd=13, id=0x575a04a9bd88)
DEBUG: Attempting to remove socket 8 (fd=14, id=0x575a04a9bdd0)
DEBUG: Attempting to remove socket 9 (fd=15, id=0x575a04a9be18)
DEBUG: Attempting to remove socket 10 (fd=16, id=0x575a04a9be60)
DEBUG: Attempting to remove socket 11 (fd=17, id=0x575a04a9bea8)
DEBUG: Attempting to remove socket 12 (fd=18, id=0x575a04a9bef0)
DEBUG: Attempting to remove socket 13 (fd=19, id=0x575a04a9bf38)
DEBUG: Attempting to remove socket 14 (fd=20, id=0x575a04a9bf80)
DEBUG: Attempting to remove socket 15 (fd=21, id=0x575a04a9bfc8)
DEBUG: Attempting to remove socket 16 (fd=22, id=0x575a04a9c010)
DEBUG: Attempting to remove socket 17 (fd=23, id=0x575a04a9c058)
DEBUG: Attempting to remove socket 18 (fd=24, id=0x575a04a9c0a0)
DEBUG: Attempting to remove socket 19 (fd=25, id=0x575a04a9c0e8)
DEBUG: Attempting to remove socket 20 (fd=26, id=0x575a04a9c130)
DEBUG: Attempting to remove socket 21 (fd=27, id=0x575a04a9c178)
DEBUG: Attempting to remove socket 22 (fd=28, id=0x575a04a9c1c0)
DEBUG: Attempting to remove socket 23 (fd=29, id=0x575a04a9c208)
DEBUG: Attempting to remove socket 24 (fd=30, id=0x575a04a9c250)
DEBUG: Actually removed 25 sockets, failed 0
Remove 25 sockets: 19 us (0.76 us per socket)
Total time: 45 us
Average per operation: 0.90 us
SKIPPING memory stats for corruption testing
🔍 BEFORE_DESTROY: UASYNC Resource Report for 0x575a04a9b2b0
Timer Statistics: allocated=0, freed=0, active=0
Socket Statistics: allocated=25, freed=25, active=0
Active timers in heap: 0
Socket array capacity: 32, 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