-
Notifications
You must be signed in to change notification settings - Fork 171
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
Operations.Send() is radically slow #3638
Comments
Hi @nickger! Thanks for bringing this up. The That being said... 👇🏼 Does the performance issue still exist if you wrap your i.e. var rootObject = new Base();
rootObject["@data"] = dataQueue.ToList()
await Operations.Send(data, transp, false); If your use-case has some limitations that require you to use a queue instead for performance reasons, then your proposed code seems like it should do the trick just fine. Out of curiosity, how many objects would you expect to come out of the |
Hi, Alan. |
We're working on improving performance left and right throughout the codebase, so thanks for the feedback. We'll update the docs to reflect your comment, as it's true it can be misleading. |
What package are you referring to?
Operations.
Describe the bug
Operations.Send() demonstrates a very slow performance in general and particularly for SQLiteTransport. I've decided to report it as a bug because it is not a small issue: real projects require too much time to export. Currently the time to write locally 7500 elements is about 10 min. I've not checked server transport, but the issue is not in transport code (see below).
To Reproduce
A high level code to send the data collected in a queue from Revit (Task.Run is omitted):
Additional context
We use local transports to speed up the development and enable local collaboration instead of using Speckle Server for experiments. I am entirely sure this is also important for other users and developers.
Proposed Solution (if any)
The code wich explicitelly repeats the same steps but with modified awaiter for transport write finish:
The point is: Operations.SerializerSend() creates tasks to wait for EVERY object write operation. This is an overkill: we need to wait the transport globally, not for each object. Moving this method outside to the level, where the transport is instantiated resolves the issue. This must also be documented - that waiting for the writer is not a responsibility of the sender.
The text was updated successfully, but these errors were encountered: