Return to search

A performance evaluation of concurrent programming with the Swift actor model / En prestandautvärdering av samtidig programkörning med actor-modellen i Swift

The Swift programming language recently introduced the actor model alongside Swift concurrency as a first-class citizen. Previously, concurrent programming in Swift required importing modules, e.g., Grand Central Dispatch. Grand Central Dispatch is a concurrency framework, often used for implementing shared memory concurrency in Swift. In contrast to Grand Central Dispatch, the Swift actor provides implicit mutual exclusion via message passing concurrency and the notion of actor isolation. This thesis evaluates the performance of the Swift actor and Swift concurrency in comparison to thread-safe objects with Grand Central Dispatch. The study assembled a benchmark suite to measure the performance over central bottlenecks (Chameneos), large counts of independent objects (Dining Philosophers), long-living concurrent objects (Dining Philosophers) and massively parallel messaging (Big). The results indicate the lack of a catch-all solution to concurrent programming in Swift. In comparison to Grand Central Dispatch, a system of actors tends to require more memory to finish execution. By upper bounding concurrency in actors, memory use is effectively limited at the cost of possibly longer execution times. In particular, the results were gathered on a macOS computer. With unique implementations of threads in different operating systems, further studies are needed to evaluate Swift concurrency and the Swift actor on other systems and hardware. In addition, further studies may evaluate the risk of congestion at large numbers of concurrent actors. / Programmeringsspråket Swift introducerade nyligen actor-modellen med Swift concurrency som en förstklassig medborgare. Samtidig programmering i Swift krävde importmoduler innan dess, t.ex. Grand Central Dispatch. Grand Central Dispatch är ett ramverk för samtidighet och används ofta för att implementera samtidighet med delat minne i Swift. I kontrast till Grand Central Dispatch tillhandahåller Swift actors implicit ömsesidig uteslutning via message passing och actor-isolering. Detta examensarbete utvärderar prestandan av Swift actors och Swift concurrency i jämförelse med trådsäkra objekt via Grand Central Dispatch. Studien sammanställde en benchmark suite för att mäta prestandan över centrala flaskhalsar (Chameneos), stora antal oberoende objekt (Dining Philosophers), samtidiga objekt med långa liv (Dining Philosophers) och massivt parallella meddelanden (Big). Resultaten indikerar en avsaknad av en fullständig lösning för samtidig programmering i Swift. I jämförelse med Grand Central Dispatch tenderar ett system av Swift actors att använda mer minne för att slutföra exekvering. Med en övre gräns för samtidighet hos actors begränsas minnesanvändningen effektivt med eventuellt längre exekveringstider. Denna studie samlade resultat med en macOS-dator. Med unika implementeringar av trådar i olika operativsystem behövs ytterligare studier för att utvärdera Swift concurrency och Swift actors på andra system och hårdvaror. Dessutom kan ytterligare studier utvärdera risken av trängsel vid stora antal samtidiga actors.

Identiferoai:union.ndltd.org:UPSALLA1/oai:DiVA.org:kth-323492
Date January 2022
CreatorsDiaz, Alex
PublisherKTH, Skolan för elektroteknik och datavetenskap (EECS)
Source SetsDiVA Archive at Upsalla University
LanguageEnglish
Detected LanguageSwedish
TypeStudent thesis, info:eu-repo/semantics/bachelorThesis, text
Formatapplication/pdf
Rightsinfo:eu-repo/semantics/openAccess
RelationTRITA-EECS-EX ; 2022:834

Page generated in 0.002 seconds