-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node creation and destruction slow. Closes #233 #263
Conversation
Created benchmarks for node creation from the
It seems like the |
This is the latest benchmark results (after successful tests)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking Good. LGTM!!
Closes #233
Objective
This PR aims to make the
Node
creation and destruction (along with otherNode
operations like P2P connections) operations yield better speed and performance. This meant using anExecutor
to haveasync
methods to control subprocess start and stop. Previously we would useAsyncLoopThread
as a bridge to combine sync/async APIs. However, this had the negative affect of multiple eventloops that cannotawait
other eventloop's tasks. This prevented the re-use of resources, likeaiohttp.ClientSession
. Through this refactoring, a single eventloop can be used and resources are better managed.TODO:
Major Breaking Changes:
Before using a
Manager
orWorker
instance, it is now required to runaserve
orserve
to start their services. This change was necessary to make async version of theManager
/Worker
use the pre-existing eventloop and avoid resource duplication, asawait
cannot be used within a__init__.py
.Before
After
Minor Breaking Changes
This
aserve/serve
change also affect theNode
-- this should not affect external dependencies that much, but it does impact an approach to debugging theNode
implementations.Before
After