Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Thinktecture Webinar: Web-API mit Turbo:Deep-d...
Search
Sebastian Gingter
February 16, 2022
Programming
0
910
Thinktecture Webinar: Web-API mit Turbo: Deep-dive in async/await für Backend-APIs
Slides for my webinar.
Sebastian Gingter
February 16, 2022
Tweet
Share
More Decks by Sebastian Gingter
See All by Sebastian Gingter
cim Lingen 2024 - Wieso versteht mich der Computer auf einmal? - Wir lüften das Geheimnis von Embeddings
phoenixhawk
0
5
cim Lingen 2024 - Prompt Injections, Halluzinationen & Co. - LLMs sicher in die Schranken weisen
phoenixhawk
0
5
BASTA! 2024: Real-World RAG: Eigene Daten & Dokumente mit semantischer Suche & LLMs erschließen
phoenixhawk
0
8
AI in Action mit GPT & Co. – Sprachzentrierte Business-Anwendungen mit Large Language Models
phoenixhawk
0
15
Webinar: Schutz vor Halluzinationen und Prompt Injections
phoenixhawk
0
85
DWX 2024 - Advanced RAG
phoenixhawk
0
110
Generative_AI_Infodays_-_Prompt_Injections_Halluzinationen_und_Co_-_LLMs_sicher_in_die_Schranken_weisen.pdf
phoenixhawk
0
69
Warum versteht mich der Computer auf einmal? Wir lüften das Geheimnis von Embeddings
phoenixhawk
0
62
Schutz vor Halluzinationen und Prompt Injections: Absicherung von LLM-Integrationen in Business-Apps
phoenixhawk
1
440
Other Decks in Programming
See All in Programming
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
630
いまから追い上げる、Jetpack Compose トレーニング
nyafunta9858
0
590
マイグレーションコード自作して File-Based Routing に自動移行!! ~250 ページの歴史的経緯を添えて~
cut0
1
260
エンジニア1年目で複雑なコードの改善に取り組んだ話
mtnmr
3
2k
Kotlin 2.0 and Beyond
antonarhipov
2
150
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
仮想ファイルシステムを導入して開発環境のストレージ課題を解消する
segadevtech
2
550
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
Scala アプリケーションのビルドを改善してデプロイ時間を 1/4 にした話 | How I improved the build of my Scala application and reduced deployment time by 4x
nomadblacky
1
180
The Shape of a Service Object
inem
0
520
はじめてみよう量子プログラミング
itokoichi01
0
210
2024 컴포즈 정원사
jisungbin
0
150
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.4k
Design by the Numbers
sachag
277
19k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
190
16k
The Mythical Team-Month
searls
218
43k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
166
48k
Ruby is Unlike a Banana
tanoku
96
11k
The Language of Interfaces
destraynor
153
23k
Teambox: Starting and Learning
jrom
131
8.7k
Speed Design
sergeychernyshev
22
430
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
120
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
36
2.1k
Transcript
None
2 Deep-dive in async/await bei Backend-APIs ▪ 🐻💬 ▪ ▪
▪ ▪ ▪ ▪ ▪ ▪ Twitter:
3 ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await bei
Backend-APIs
4 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
5 Deep-dive in async/await bei Backend-APIs Nein, aber effizienter!
6 Deep-dive in async/await bei Backend-APIs
7 ▪ ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in
async/await bei Backend-APIs
8 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 P3 T1 P1 T2 P3 T2 OS Scheduler P1 T1
9 • • • ▪ ▪ ▪ ▪ ▪ Deep-dive
in async/await bei Backend-APIs * Zahlen für Windows, Quelle: “Windows Internals“, Solomin, Russinovich et al. Jeffrey Richter sagt hingegen: 30 ms in Windows, Linux hat andere Zeiten…
10 • • • • • • • • •
• Deep-dive in async/await bei Backend-APIs
11 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 P3 T1 P1 T1 P3 T2 P1 T2 Kontext- Wechsel Kontext- & Prozess- Wechsel
12 • • • • • • • • •
Deep-dive in async/await bei Backend-APIs
13 Deep-dive in async/await bei Backend-APIs ALU & FPU Registers
0 Registers 1 CPU Core with Hyper-Threading Classic CPU Core
14 Deep-dive in async/await bei Backend-APIs Kern 1 Kern 2
Kern 3 Kern 4 P2 T1 P2 T2 MyProc T1 P1 T2 P1 T1 MyProc T2 MyProc T3 MyProc T4 MyProc T5 MyProc T7 MyProc T6
15 Deep-dive in async/await bei Backend-APIs • • • Quelle:
“Systems Performance: Enterprise and the Cloud“, 2013, Brendan Gregg, Pearson Verlag
16 Deep-dive in async/await bei Backend-APIs • • • •
• •
17 Deep-dive in async/await bei Backend-APIs
18 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ ▪
▪ Deep-dive in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
19 ▪ ▪ ▪ ▪ ▪ ▪ ⏳ ▪ Deep-dive
in async/await bei Backend-APIs ReadFile API: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile
20 Deep-dive in async/await bei Backend-APIs
21 Deep-dive in async/await bei Backend-APIs • • IAsyncResult BeginSomething()
• EndSomething(result) • • DoSomethingAsync() • event SomethingCompleted • • Task[<T>] DoSomethingAsync() P
22 Deep-dive in async/await bei Backend-APIs
23 • • • • • • .ContinueWith() • Deep-dive
in async/await bei Backend-APIs
24 Deep-dive in async/await bei Backend-APIs Task Task-Liste Threadpool T1
Threadpool T2 Kern 1 Kern 3 Kern 2 Kern 4 Threadpool T3 Threadpool T4 Threadpool Management Jeder Pool-Thread arbeitet Tasks in einer Endlosschleife ab Completed Tasks
25 • • • • • 🤯 • • Deep-dive
in async/await bei Backend-APIs
26 Deep-dive in async/await bei Backend-APIs
27 • • async Task<> MyMethodAsync() • • • await
OtherMethodAsync() • • await • • • • Deep-dive in async/await bei Backend-APIs E
28 Deep-dive in async/await bei Backend-APIs
29 Deep-dive in async/await bei Backend-APIs P
30 • • task.GetAwaiter().GetResult() → ❌ • Thread.Sleep() → ❌
• await Task.Delay() → ✔ • Thread.SpinWait() • → ❌ • → ✔ Deep-dive in async/await bei Backend-APIs
31 • • var task1 = DoSomethingAsync(); var task2 =
DoSomethingElseAsync(); await Task.WhenAll(task1, task2); • • • Task.Factory.StartNew(…, TaskCreationOptions.LongRunning); • • • Deep-dive in async/await bei Backend-APIs
32 • • • • Deep-dive in async/await bei Backend-APIs
33 Deep-dive in async/await bei Backend-APIs
34 ▪ ▪ ▪ ▪ ▪ ▪ Deep-dive in async/await
bei Backend-APIs
35 ▪ ▪ ▪ ▪ ▪ 😉 Deep-dive in async/await
bei Backend-APIs P
None