Skip to content

Commit ff93c28

Browse files
Extend README.md
1 parent 6b75ef8 commit ff93c28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Sign up to my [newsletter](https://www.lukaslechner.com/newsletter/) to get more
5353
14. [Continue Coroutine execution even when the user leaves the screen](#14-continue-coroutine-execution-when-the-user-leaves-the-screen)
5454
15. [Using WorkManager with Coroutines](#15-using-workmanager-with-coroutines)
5555
16. [Performance analysis of dispatchers, number of coroutines and yielding](#16-performance-analysis-of-dispatchers-number-of-coroutines-and-yielding)
56+
17. [Perform expensive calculation on Main Thread without freezing the UI](#17-perform-expensive-calculation-on-main-thread-without-freezing-the-ui)
5657

5758
## 📄 Description
5859

@@ -196,6 +197,11 @@ example, we are sending an analytics request when the user enters the screen, wh
196197
This is an extension of use case #12 (Offload expensive calculation to several coroutines). Here it is possible to additionally define the dispatcher type you want
197198
the calculation to be performed on. Additionally, you can enable or disable the call to `yield()` during the calculation. A list of calculations is displayed on the bottom in order to be able to compare them in a convenient way.
198199

200+
### 17. Perform expensive calculation on Main Thread without freezing the UI
201+
202+
This example shows how you can perform an expensive calculation on the main thread in a non-blocking fashion. It uses `yield()` for every step in the calculation so that other work, like drawing the UI, can be performed
203+
on the main thread. It is more a "showcase" rather than a use case for a real application, because of performance reasons you should always perform expensive calculations on a background thread (See UseCase#10).
204+
199205

200206
You can play around and check the performance of different configurations!
201207

0 commit comments

Comments
 (0)