Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

index of talks about performance in Swift guide added #80

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

shilpeegupta14
Copy link

@shilpeegupta14 shilpeegupta14 commented Feb 9, 2022

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
vi) Drawbacks of CoW

Concurrency and Locking

i) Race Condition with Semaphores
ii) Priority inversion with Semaphores
iii) Thread explosion
iv) Runtime contract and rewriting code with async/await semantics for better performance of the code.
iv) Synchronization offering:

  1. Mutual Exclusion
    This covers:
    i) Actors with data races when we are accessing the mutable states within the actors
    ii) Actors with data races when we are accessing the mutable states outside the actors and fixing it with sendable
    protocols
  2. Reentrancy and Prioritization
    This covers actors with Priority Inversion
  3. Main Actor
    Batching up code to improve time complexity and performance

v) Potential bug around await semantics
vi) Other primitives and 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/
https://developer.apple.com/videos/play/wwdc2021/10133/

Result:

Resolves: #64 guide for writing high performance systems in swift

@shilpeegupta14 shilpeegupta14 changed the title High performance systems in swift guide added High performance systems/index of talks about performance in Swift guide added Feb 13, 2022
@tomerd
Copy link
Contributor

tomerd commented Feb 24, 2022

task again for the PR @shilpeegupta14

circling back to the feedback on #78: iiuc correctly this content mostly summarizes talks available publicly, which is what is pointed out in the "references" section above. if this is true, perhaps we can -restructure the suggested content around talks rather then as a "performance guide"? i.e

  1. have an index page with a list of talks, having each entry link to the the talk recording and the summary (item 2)
  2. have page summarizing the key take away from the talk, one page per talk

@shilpeegupta14
Copy link
Author

shilpeegupta14 commented Feb 24, 2022

@tomerd
The update pr #80 contains some additions that are not part of any WWDC talk and were not added previously in #78.
Such topics are:
drawbacks of COW
Race Condition and Priority Inversion with Semaphores
Accessing mutable state outside the actor

Also, some topics like main Actor, mutual exclusion, reentrancy and prioritisation are talked about in both the WWDC talks. https://developer.apple.com/videos/play/wwdc2021/10254/
https://developer.apple.com/videos/play/wwdc2021/10133/

Summarising them talk wise will scatter information in many parts and might cause repetition.

@shilpeegupta14 shilpeegupta14 changed the title High performance systems/index of talks about performance in Swift guide added index of talks about performance in Swift guide added Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

guide for writing high performance systems in swift
2 participants