guides
guides copied to clipboard
swift high performance guide added
High Performance in Swift guide added
Motivation
Contributing to the repository.
Description:
Overview of the readme file:
-
Class vs Struct tradeoff and Copy-on-Write i)difference btw memory allocations ii)copy-on-write iii)benchmarking structs with classes iv)implementing structs backed by classes v) implementing structs backed by classes with copy on write
-
Concurrency and Locking i) Thread explosion ii) runtime contract iii) serial queue and concurrent queue iv) Synchronization offering: 1. Mutual Exclusion 2. Reentrancy and Prioritization 3. Main Actor vii) Batching up code to improve time complexity viii) Lock Contention Pattern
References:
https://www.youtube.com/watch?v=iLDldae64xE https://www.youtube.com/watch?v=WCUj581Dpec https://developer.apple.com/videos/play/wwdc2021/10254/
Result:
Resolves: guide for writing high performance systems in swift
if there are any additions or deletions in my pr. Let me know!
thanks @shilpeegupta14 will take a look shortly
thanks or putting this together @shilpeegupta14
since this seems to be summarizing existing resources on the internet, how about we change the PR to be an "index for talks about performance in Swift"? this way we can add more links as we have more resources instead of repeating them. wdyt?
@tomerd thanks for taking out time to review this guide.
I am comfortable with the idea of changing the name of the pr and adding more resources. Some topics that I thought to write but wasn't sure if that comes in "high performance". Would like to know if I should add this or not:
- copy on write on indices and on arrays, dictionaries.
- operation queue vs gcd
topics/parts that I totally missed but will add:
- how dispatch semaphore can handle race conditions. tradeoffs of dispatch semaphore and how they can lead to priority inversion and deadlocks.
- how actors handle data races
- async/await performance
If there are anymore resources to add, let me know. If I get any related one to performance in swift, I will add up on this.
@tomerd The pr shifted to https://github.com/swift-server/guides/pull/80 Sorry for the inconvenience