You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was testing how many RPC calls BlackBone can do per second, and was a bit disappointed when I found that on my machine, it could only do 65 calls per second. Now I'm sure there's a lot of overhead for executing remote code, but 65 sounds very low even when considering that. Now what I mean by "RPC call" is RemoteFunction::Call() in a dedicated worker thread, so basically RemoteExec::ExecInWorkerThread(). I looked at that method, and this line immediately jumped at me:
// Ensure APC function fully returnsSleep( 1 );
Naive as I am, I just commented this line out, and the number of RPC calls per second rose to ~8800, a factor of more than 100 more. That's closer to what I hoped for. What's more: In my admittedly very basic and unscientific test (calling a single remote function repeatedly that adds two numbers and returns the result), everything was still working fine.
So what's the actual reason for this Sleep(1)? Is it really necessary? Is there no other easy way to wait for whatever this is waiting for that does not waste so much time? Or do you have another idea for getting more RPC calls per second out of BlackBone?
The text was updated successfully, but these errors were encountered:
I finally got around to checking on this again, and found out that the Sleep() can't simply be removed without further changes to the code. Doing that leads to rare crashes in KiUserApcDispatcher() because a new RPC call is started while the old one hasn't fully finished yet, overwriting data needed by the previous call.
The good news is that I hopefully solved it properly in this pull request, which avoids both the race condition and the arbitrary Sleep(), leading to pretty much the same factor 100 speed improvement without introducing instabilities.
I was testing how many RPC calls BlackBone can do per second, and was a bit disappointed when I found that on my machine, it could only do 65 calls per second. Now I'm sure there's a lot of overhead for executing remote code, but 65 sounds very low even when considering that. Now what I mean by "RPC call" is
RemoteFunction::Call()
in a dedicated worker thread, so basicallyRemoteExec::ExecInWorkerThread()
. I looked at that method, and this line immediately jumped at me:Naive as I am, I just commented this line out, and the number of RPC calls per second rose to ~8800, a factor of more than 100 more. That's closer to what I hoped for. What's more: In my admittedly very basic and unscientific test (calling a single remote function repeatedly that adds two numbers and returns the result), everything was still working fine.
So what's the actual reason for this
Sleep(1)
? Is it really necessary? Is there no other easy way to wait for whatever this is waiting for that does not waste so much time? Or do you have another idea for getting more RPC calls per second out of BlackBone?The text was updated successfully, but these errors were encountered: