Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
ARC vs. GC?ARC in GC?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Shigure Shimotori
September 16, 2017
Programming
1.5k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ARC vs. GC?ARC in GC?
https://iosdc.jp/2017/node/1349
Shigure Shimotori
September 16, 2017
More Decks by Shigure Shimotori
See All by Shigure Shimotori
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
92
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
520
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
450
おっと、お飲みごろの時間です!
s_shimotori
1
170
Synchronizationを支える技術
s_shimotori
1
340
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
1.5k
英語
s_shimotori
1
1.3k
Parallel Socket Communication in Swift
s_shimotori
1
1k
UIColor Anatomy
s_shimotori
1
3.1k
Other Decks in Programming
See All in Programming
XP祭りでしか伝わらないフリップネタ #xpjug
murabayashi
0
140
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
240
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
550
MIZARU@SPAJAM2026 第二回予選
1901drama
0
110
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
160
思考垂れ流し開発 ~音声入力 × AIエージェント × 開発ハーネスによる試行錯誤~
npostring
0
1.1k
標準パッケージに uuid が追加された 背景から見る Go らしい意思決定 / go_127_uuid_decision
convto
5
6.2k
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
470
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
110
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
130
初心者DevRelとして参加者だった私が、DevRel Talks!#2に登壇するまでにしてきたこと
sokohirai
0
360
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
150
Featured
See All Featured
Abbi's Birthday
coloredviolet
3
9.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.3k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
It's Worth the Effort
3n
188
29k
How to Talk to Developers About Accessibility
jct
2
540
How to Ace a Technical Interview
jacobian
281
24k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Accessibility Awareness
sabderemane
1
210
Testing 201, or: Great Expectations
jmmastey
46
8.3k
The untapped power of vector embeddings
frankvandijk
2
1.9k
Transcript
iOSDC JAPAN 2017 #1349 ARC vs. GCʁARC in GCʁ @S_Shimotori
ͩΕʁ • @S_Shimotori / @S_Shimotori_pub • ϞϥτϦΞϜ ֶੜ • Swift͕͖ͳͷͰSwiftΛॻ͍͍ͯ·͢
• SPMΛͬͨΓiOSΛͬͨΓ͠·͢
ARC vs. GC ʘŲōŘŕ!!ʗ
ਓྨARCͱGCΛൺֱ͕ͪ͠ • GCΛΊͯARCʹ͠·͢ - Apple Guides and Sample Code[1] •
ARCͱGCͷҧ͍ͬͯͳʹ - Stack Overflow[2] • ARC͔ΒGCʹม͑ͨ΄͏͕͍͍Μ͡Όͳ͍ͷ - Swift evolution[3] [1] https://developer.apple.com/library/content/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html [2] https://stackoverflow.com/questions/7874342/what-is-the-difference-between-objective-c-automatic-reference-counting-and-garb [3] https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160208/009403.html 4
• ͋ͷJVM͕࠾༻ͨ͠ϝϞϦཧํ๏ • ώʔϓྖҬΛෳ(youngྖҬͱoldྖҬͳͲ)ʹ͚ͯ͏ • youngྖҬ͔Βॱ൪ʹ͍ͬͯ͘ • શྖҬΛ͍ͬͨ࣌ͷϑϧGC͕ා͍ • JVMʹΨϕʔδίϨΫλ͕ෳ༻ҙ͞Ε͍ͯΔ
• ༻్ʹ߹ͬͨΞϧΰϦζϜͷͷΛ͏ ΈΜͳେ͖ʮΨϕʔδίϨΫγϣϯʯ 5 ͦΕΛGCͬͯݴ͍͍ͬͯͷʁʁ ❌
͜Ε͕ຊͷΨϕʔδίϨΫγϣϯʂ • ࣗಈͰෆཁͳΦϒδΣΫτΛ୳͠ϝϞϦΛղ์͢Δ • ϝϞϦղ์ͷλΠϛϯάΛߟ͑ͳͯ͘Α͍ • ͍ͭͰʹϝϞϦྖҬΛཧ͢Δ͜ͱ͋Δ • ํ๏ͷҟͳΔ3छͷΨϕʔδίϨΫλ͕͋Δ •
ࢀরΧϯτ • ϚʔΫΞϯυεΠʔϓ • ίϐʔGC • ୯ʹGCͱݺΜͩ߹τϨʔγϯάίϨΫλΛࢦ͢ • JVMͷGCτϨʔγϯάίϨΫλͷҰछ(ੈผGC) } τϨʔγϯάίϨΫλ 6
ARCGCͱରཱ͢Δ͠ GCͷҰछͰ͋Δ
ͱ͜ΖͰɼ
Cyclone/Rustͷ ॴ༗ݖϞσϧɼ ਅࣅͪ͠Ό͓͏
࠾༻͍ͯ͠ΔϝϞϦཧํ๏Ͱ ͬ͘͟Γ Θ͚ͯΈͨ खಈ C ಈతࣗಈ (ٛͷGC) ࢀরΧϯτ τϨʔγϯάίϨΫλ(ڱٛͷGC) Swift/ObjC
Java Ruby D ※ݴޠࣗʹGC͕ͳ͍ͷͰϥΠϒϥϦ͕࡞ΒΕ͍ͯΔ͜ͱ͕͋Δɽ ※ओʹ͍ͬͯΔํ๏ͷΈͰ͚ͨͷͰʮͬ͘͟ΓʯɽCycloneGCΛ෦తʹ͍ͬͯΔ͠ɼJava੩తղੳΛ͍ͯ͠Δɽ OCaml .NET C++ LISP Pascal ੩తࣗಈ 10 Cyclone Python Rust
CycloneͱRust ϝϞϦཧͷେઌഐʂ
·ͱΊ
·ͱΊ • ARCGCͱൺֱ͞ΕΔ͠ɼGCͷҰһͰ͋Δ • ٛͷGCͱڱٛͷGCͰࢦ͍ͯ͠Δͷ͕ҧ͏ • CycloneRustϝϞϦཧʹऔΓΜͰ͖ͨେઌഐ • ઌഐݴޠͷऔΓΈ͕ͱͯࢀߟʹͳΔ͔ 13
͓͠·͍ʂ
ࢀߟจݙ • ΨϕʔδίϨΫγϣϯͱͳΜͧɽ • ൧ݟʰΨϕʔδίϨΫγϣϯͷ࣮๏ͱධՁʱ<http://www.net.c.dendai.ac.jp/~takumi/>ɼ(ࢀর2017-09-11)ɽ • ԕ౻හʮҰൠڭཆͱͯ͠ͷGarbage Collection (ίϯύΠϥԋश൪֎ฤ)ʯ<http://matsu-www.is.titech.ac.jp/~endo/gc/gc.pdf>ɼ(ࢀর2017-09-11)ɽ •
ΑͦͷݴޠͰͷϝϞϦཧઓུ • Scott Oaksஶ(2015)ʰJavaύϑΥʔϚϯεʱ૱༁ɼגࣜձࣾΦϥΠϦʔɾδϟύϯɽ • ੨ๆʰRubyιʔείʔυશղઆʱ<http://loveruby.net/ja/rhg/book/>ɼ(ࢀর2017-09-11)ɽ • OCamlʰΨϕʔδίϨΫγϣϯ – OCamlʱ<https://ocaml.org/learn/tutorials/garbage_collection.ja.html>ɼ(ࢀর2017-09-11)ɽ • MicrosoftʰGarbage Collectionʱ<https://msdn.microsoft.com/ja-jp/library/0xy59wtx(v=vs.110).aspx>ɼ(ࢀর2017-09-11)ɽ • Jeffrey Richterஶ(2013)ʰϓϩάϥϛϯά .NET Framework ୈ4൛ʱ౻ݪ༤հ༁ɼܦBPࣾɽ • Digital MarsʰΨϕʔδίϨΫγϣϯ - ϓϩάϥϛϯάݴޠ D (ຊޠ༁)ʱ<http://www.kmonos.net/alang/d/garbage.html>ɼ(ࢀর2017-09-11)ɽ • naruseʰRuby 2.2.0 ϦϦʔεʱ<https://www.ruby-lang.org/ja/news/2014/12/25/ruby-2-2-0-released/>ɼ(ࢀর2017-09-11)ɽ • CycloneʰCyclone: User Manualʱ<http://cyclone.thelanguage.org/wiki/User%20Manual/>ɼ(ࢀর2017-09-12)ɽ • Robert C. Seacordஶ(2014)ʰC/C++ηΩϡΞίʔσΟϯά ୈ2൛ʱՎਖ਼΄͔༁ɼגࣜձࣾKADOKAWAɽ • Richard Reeseஶ(2013)ʰৄઆ CϙΠϯλʱ٠জ༁ɼגࣜձࣾΦϥΠϦʔɾδϟύϯɽ • Pythonʰcpython/gcmodule.c at 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6 · python/cpythonʱ<https://github.com/python/cpython/blob/ 2ebc5ce42a8a9e047e790aefbf9a94811569b2b6/Modules/gcmodule.c>ɼ(ࢀর2017-09-13)ɽ • Neil SchemenauerʰGarbage Collection for Pythonʱɼ(ࢀর2017-09-13)ɽ
ࢀߟจݙ • Swiftͷߦ͍͔͘ʹɽ • Appleʰswift/OwnershipManifesto.md at fa2f2bd4577e536130f9298fabfd2960a357693c · apple/swiftʱ<https://github.com/apple/swift/blob/ fa2f2bd4577e536130f9298fabfd2960a357693c/docs/OwnershipManifesto.md>ɼ(ࢀর2017-09-11)ɽ
• Appleʰswift-evolution/0176-enforce-exclusive-access-to-memory.md at b9d815099453912069998b579948a3319246042b · apple/swift-evolutionʱ<https:// github.com/apple/swift-evolution/blob/b9d815099453912069998b579948a3319246042b/proposals/0176-enforce-exclusive-access-to-memory.md>ɼ(ࢀর 2017-09-11)ɽ • Appleʰ [swift-evolution] RFC: Preventing Retain Cycles (Memory Ownership Model)ʱ<https://lists.swift.org/pipermail/swift-evolution/Week-of- Mon-20160725/025695.html>ɼ(ࢀর2017-09-12)ɽ • ૉࡐ • TopeconHeroesʰਧ͖ग़͠ૉࡐઐαΠτʮϑΩμγσβΠϯʯʱ<http://fukidesign.com/>ɼ(ࢀর2017-09-11)ɽ
εϥΠυʹࡌͤͳ͔͚ͬͨͩͲಡΜͩΒ໘ന͍͔ • ͬͱGCΛษڧ͢Δ • ౦ژେֶใՊֶՊʰIndex of Compiler Resumeʱ<http://www.is.s.u-tokyo.ac.jp/vu/jugyo/processor/process/soft/compilerresume/index.html>ɼ(ࢀর2017-09-16)ɽ • ాӜ
݈࣍࿕ʮϓϩάϥϛϯάݴޠ 6 ΨϕʔδίϨΫγϣϯ(2)ʯ<https://www.eidos.ic.i.u-tokyo.ac.jp/~tau/lecture/programming_languages/gen/slides/pdf/06-gc- adv.pdf>ɼ(ࢀর2017-09-16)ɽ • ੈͷதʹ·ͩͨ͘͞Μͷݴޠ͕͋Δ • garicchiʰComponent Object Model(COM)ͱԿ͔ ·ͱΊΔ – garicchi.comʱ<http://garicchi.com/?p=19259>ɼ(ࢀর2017-09-13)ɽ • தౡେҰʰGolangͷGCΛ͏ | SOTAʱ<http://deeeet.com/writing/2016/05/08/gogc-2016/>ɼ(ࢀর2017-09-11)ɽ • ຊ༟لʰPerlͷΨʔϕοδίϨΫγϣϯ(GC)ͷಛੑʹ͍ͭͯ - PerlͳΒαϯϓϧίʔυPerlೖʱ<http://d.hatena.ne.jp/perlcodesample/20131010/1381413409>ɼ(ࢀর 2017-09-11)ɽ • ຊ༟لʰʮϦϑΝϨϯεΧϯτࣜͷGCʯɺITքͰGCͱೝࣝ͞Ε͍ͯͳ͍ͷͩΖ͏͔? - Qiitaʱ<http://qiita.com/yukikimoto/items/3964b107107cc52f8f51>ɼ(ࢀর 2017-09-11)ɽ • ʰΨʔϕδίϨΫγϣϯ - ݴޠผGCͷΈ(31402)ʛteratailʱ<https://teratail.com/questions/31402>ɼ(ࢀর2017-09-12)ɽ • SwiftͲ͏ͳΔͷ • খক೭ʰSwift 3ͷ։ൃͷৼΓฦΓͱSwift 4ͷܭը͕ه͞Εͨϝʔϧͷհ - Qiitaʱ<http://qiita.com/mono0926/items/c51b74fae679e1e39d2b>ɼ(ࢀর2017-09-12)ɽ • দؗେًʰSwift5ͷ͕ٞελʔτ:ABIͷ҆ఆԽɺฒߦॲཧɺݴޠͷਐԽϓϩηεͷมߋ – Daiki Matsudate – Mediumʱ<https://medium.com/@d_date/ swift5%E3%81%AE%E8%AD%B0%E8%AB%96%E3%81%8C%E3%82%B9%E3%82%BF%E3%83%BC%E3%83%88- abi%E3%81%AE%E5%AE%89%E5%AE%9A%E5%8C%96-%E4%B8%A6%E8%A1%8C%E5%87%A6%E7%90%86- %E8%A8%80%E8%AA%9E%E3%81%AE%E9%80%B2%E5%8C%96%E3%83%97%E3%83%AD%E3%82%BB%E3%82%B9%E3%81%AE%E5%A4%89%E6%9B%B4-6b6540 acd6e4>ɼ(ࢀর2017-09-12)ɽ