Asyncore poller efficiency #1380
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-05#1380
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Asyncore pollers initialise the poller objects for every poll. This causes inefficiency when using a huge number of connections. It's only necessary to do it this way for the select poller, the others can reuse an old object. To fix this requires some refactoring, instead of performing a check and set/reset for every connection for every poll, the set/reset can be done when the write or read buffer get updated. This reduces the number of checks as well as syscalls. I managed to get a prototype working on one of the bootstrap servers, and it reduced the CPU usage of the asyncore loop by a factor of 6. However it needs more work as it was only done with the epoll poller, and I had to disable the bandwidth limit functionality.