Ksenia Shneyveys
07/13/2023, 3:17 PMJoel Denke
07/13/2023, 5:32 PMLoïc Lamarque
07/13/2023, 9:36 PMEdoardo Luppi
07/14/2023, 9:48 AMJohn Matthews
07/14/2023, 8:43 PM윤동환
07/16/2023, 12:29 AMZach Klippenstein (he/him) [MOD]
07/17/2023, 6:26 PMNorbi
07/22/2023, 8:44 PMkotlinx-io@Ksenia Shneyveys, why choose an API as the base of the new library where I/O operations are not
suspend
? 🤔Stephan Schröder
07/24/2023, 7:44 AM윤동환
07/24/2023, 7:47 AMStephan Schröder
07/24/2023, 8:19 AMJoel Denke
07/24/2023, 8:21 AMZach Klippenstein (he/him) [MOD]
07/24/2023, 4:03 PMkotlinx-io
@Ksenia Shneyveys, why choose an API as the base of the new library where I/O operations are not@jessewilson can answer this better than me, but I believe that the overhead of coroutines was unacceptable for low-level io operations.? 🤔suspend
jessewilson
07/24/2023, 5:35 PMjessewilson
07/24/2023, 5:44 PMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
and then doing a bunch of blocking calls is likely to be meaningfully faster than doing many suspending calls
Retrofit’s suspend feature works this way. I think both its API and its performance are great. Doing a suspend call for every byte processed would harm performance without improving the developer experience.Norbi
07/24/2023, 7:52 PMlikely to be meaningfully fasterAlthough in this case I have a feeling that performance is prioritized over "correctness". @elizarov said multiple times how important it is to differentiate between suspend and non-suspend functions for code "correctness". Besides, if suspend functions are dropped for performance reasons, then it is a very bad message for ktor users... (I don't want to seem very clever, I was just very surprised by this decision. And I know that this thread is not the best place for this discussion, too 🙂 )
Joffrey
07/25/2023, 1:22 PM