IO performance improvements #1361
louthy
announced in
Announcements
Replies: 1 comment
-
Thank you for the honor. Regards |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In one of the proposals leading up to the big
v5
refactor, I discussed the idea of usingSpinWait
as a lightweight waiting technique to avoid the use of the async/await machinery everywhere. I also mentioned that the idea might be too primitive. Well, it was.So, I have modified the internals of the
IO
monad (which is where all async code lives now) to have four possible states:IOSync
,IOAsync
,IOPure
, andIOFail
. These are just types derived fromIO
(you never see them).The idea is that any actual asynchronous IO will just use the regular async/await machinery (internally in
IOAsync
), any synchronous IO will be free of async/await (inIOSync
), and any pure or failure values will have a super simplified implementation that has no laziness at all and just can pre-compute.The
TestBed.Web
sample with theTestBed.Web.Runner
NBomber test now runs both thesync
andasync
versions with exactly the same performance and with no thread starvation; and without any special need to fork the IO operation on thesync
version.I consider that a big win which will allow users to avoid async/await entirely (if they so wish), one of the goals of 'Drop all Async variants' proposal.
Issue fix
This discussion was created from the release IO performance improvements.
Beta Was this translation helpful? Give feedback.
All reactions