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
The performance is inadequate. Trying to await 1000 functions that only sleep for 100ms and return, takes around 1 second. This equates to around 1ms per async function call. I'm completely dumbfounded why this happens. I don't have time right now to try and profile this.
Returning objects from functions is not working in some cases. The C# marshaller complains that SafeHandle cannot be marshalled. This happens when future callback is being invoked. A solution could be to rework the code to use IntPtr instead of SafeHandle.
With uniffi 0.25 just around the corner, it seems like async functions have had a significant rework. I'm hoping that the changes in 0.25 might automatically solve at least one of these issues. As this is not a priority for us right now, I'm postponing async functions for later.
The text was updated successfully, but these errors were encountered:
I've noticed that uniffi-bindgen-cs currently generates invalid stubs for async methods, making it impossible to use for existing codebases with uniffi annotations.
Async function are not a priority for us, so I haven't had the time to look into this. Though generating invalid code in presence of async is not acceptable and I missed this somehow. A PR would be welcome, it shouldn't be difficult to generate "empty" or no return stubs that throw an exception when called 😉
I have tried to implement async functions for 0.24, but ran into some issues.
The performance is inadequate. Trying to await 1000 functions that only sleep for 100ms and return, takes around 1 second. This equates to around 1ms per async function call. I'm completely dumbfounded why this happens. I don't have time right now to try and profile this.
Returning objects from functions is not working in some cases. The C# marshaller complains that
SafeHandle
cannot be marshalled. This happens when future callback is being invoked. A solution could be to rework the code to useIntPtr
instead ofSafeHandle
.With uniffi 0.25 just around the corner, it seems like async functions have had a significant rework. I'm hoping that the changes in 0.25 might automatically solve at least one of these issues. As this is not a priority for us right now, I'm postponing async functions for later.
The text was updated successfully, but these errors were encountered: