Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arturwincenciak/async-await-in-il-code
How the 'async' and 'await' keywords are transformed into IL code during compilation
https://github.com/arturwincenciak/async-await-in-il-code
async-await csharp csharp-code dotnet il
Last synced: 3 days ago
JSON representation
How the 'async' and 'await' keywords are transformed into IL code during compilation
- Host: GitHub
- URL: https://github.com/arturwincenciak/async-await-in-il-code
- Owner: ArturWincenciak
- License: mit
- Created: 2022-12-28T18:56:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-28T19:33:39.000Z (about 2 years ago)
- Last Synced: 2024-12-06T04:42:21.476Z (2 months ago)
- Topics: async-await, csharp, csharp-code, dotnet, il
- Language: C#
- Homepage:
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Async/Await in IL Code
This project demonstrates how the async and await keywords are transformed into IL code during compilation.
Within the repository, you will find pairs of implementations demonstrating this concept. Each pair consists of an implementation using `async/await` and its equivalent representation in IL code, denoted by the suffix "Il" at the end of a class name.
In addition to the pairs of implementations, the repository also contains the file `ConwayCleanCode` class, which is a refactored version with the goal of improving readability for humans. While this implementation may be less efficient, it serves as a demonstration of the logic and intent behind the IL code generated during compilation.
# Output
```
Alright Async Await!01 Global - Knuth
20:08:02.767 MethodFirst
20:08:05.813 MethodSecond
02 Global03 Global - Knuth IL
20:08:05.815 MethodFirst
20:08:08.821 MethodSecond
04 Global05 Global - Graham
20:08:08.825 MethodFirst
20:08:11.821 MethodSecond
20:08:14.836 MethodThird
06 Global07 Global - Graham IL
20:08:14.841 MethodFirst
20:08:17.848 MethodSecond
20:08:20.852 MethodThird
08 Global09 Global - Riemann
20:08:20.856 MethodFirst
20:08:23.852 MethodSecond
20:08:26.852 MethodThird
20:08:29.859 MethodFourth
10 Global11 Global - Riemann IL
20:08:29.862 MethodFirst
20:08:32.861 MethodSecond
20:08:35.867 MethodThird
20:08:38.873 MethodFourth
11 Global12 Global - Conway
20:08:38.881 MethodFirst
20:08:41.876 MethodSecond
20:08:44.884 MethodThird
20:08:47.895 MethodFourth
20:08:50.908 MethodFifth
13 Global14 Global - Conway IL
20:08:50.916 MethodFirst
20:08:53.912 MethodSecond
20:08:56.921 MethodThird
20:08:59.933 MethodFourth
20:09:02.941 MethodFifth
15 Global16 Global - Conway Clean Code
20:09:02.950 MethodFirst
20:09:02.951 MethodSecond
20:09:05.953 MethodThird
20:09:05.954 MethodFourth
20:09:08.969 MethodFifth
17 Global18 Global - Planck
20:09:08.979 MethodFirst 100
20:09:08.981 MethodSecond 200
20:09:08.983 MethodThird 300
20:09:08.989 MethodFourth 400
20:09:08.991 MethodFifth 500
19 Global: 50019 Global - Planck IL
20:09:09.008 MethodFirst 100
20:09:09.009 MethodSecond 200
20:09:09.011 MethodThird 300
20:09:09.012 MethodFourth 400
20:09:09.013 MethodFirst 500
20 Global: 500
```