Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
NSCacheについて
Search
ninjinkun
March 24, 2012
Technology
2
20k
NSCacheについて
第43回Cocoa関西 で発表しました。Mac OSX / iOS組み込みのキャッシュモジュールの紹介です。
ninjinkun
March 24, 2012
Tweet
Share
More Decks by ninjinkun
See All by ninjinkun
買収から2ヶ月でシステム統合した話
ninjinkun
0
110
Designer's and Engineer's Thinking Styles
ninjinkun
0
220
Launchable Webinar テストを効率化して生産性を上げる方法
ninjinkun
2
560
ディープリンクの 設計と実装 - iOSDC2017
ninjinkun
18
10k
スマートフォンアプリ開発における共創的な開発チーム
ninjinkun
61
19k
ReSwiftでアプリの状態管理 / Reactive Swift Meetup
ninjinkun
9
17k
フリルのアプリ開発今昔物語
ninjinkun
3
2.2k
プロトタイピング合宿によるデザインリニューアル
ninjinkun
1
3.1k
デザイナーが仕事をしやすいアプリエンジニアを考える
ninjinkun
4
680
Other Decks in Technology
See All in Technology
AI時代を生き抜くエンジニアキャリアの築き方 (AI-Native 時代、エンジニアという道は 「最大の挑戦の場」となる) / Building an Engineering Career to Thrive in the Age of AI (In the AI-Native Era, the Path of Engineering Becomes the Ultimate Arena of Challenge)
jeongjaesoon
0
240
新アイテムをどう使っていくか?みんなであーだこーだ言ってみよう / 20250911-rpi-jam-tokyo
akkiesoft
0
340
普通のチームがスクラムを会得するたった一つの冴えたやり方 / the best way to scrum
okamototakuyasr2
0
110
Modern Linux
oracle4engineer
PRO
0
160
roppongirb_20250911
igaiga
1
240
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
dbt開発 with Claude Codeのためのガードレール設計
10xinc
2
1.3k
初めてAWSを使うときのセキュリティ覚書〜初心者支部編〜
cmusudakeisuke
1
280
AWSで始める実践Dagster入門
kitagawaz
1
740
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
2
190
Aurora DSQLはサーバーレスアーキテクチャの常識を変えるのか
iwatatomoya
1
1.2k
サラリーマンの小遣いで作るtoCサービス - Cloudflare Workersでスケールする開発戦略
shinaps
2
470
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
The Pragmatic Product Professional
lauravandoore
36
6.9k
The Invisible Side of Design
smashingmag
301
51k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
GraphQLとの向き合い方2022年版
quramy
49
14k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Statistics for Hackers
jakevdp
799
220k
Transcript
NSCacheʹ͍ͭͯ id:ninjinkun / @ninjinkun
ΞδΣϯμ • NSCacheͱ • ͍ํ • αϯϓϧ • http://github.com/ninjinkun/NSCacheTest •
InstagramͷΞϓϦొ͕ඞཁ
֓ཁ NSCacheͱ • ΩϟογϡϞδϡʔϧ • iOS 4.0͔Βಋೖ • εϨουηʔϑ •
֨ೲ্ݶΛઃఆՄೳ
༻్ NSCacheͱ • ը૾Ωϟογϡ • αΠζ͕Ͱ͔͍ͷͰΦϯϝϞϦʹͣͬͱஔ͚ͳ͍ • μϯϩʔυͨ͠ͷΛҰ࣌తʹอଘ͢Δ • ͦͷଞɺ༰ྔ͕େ͖ͯ͘ɺ͍Ζ͍ΖͳεϨου͔ΒΞ
Ϋηε͞Εͦ͏ͳͷͳΒԿͰ…
͍ํ • ίʔυΛݟͤΔ • ImageLoaderΫϥεʹ͍ͩ͘͝͞
্ݶͷܾఆ ͍ํ • ΦϒδΣΫτͷݸ • setCountLimit: • ΦϒδΣΫτͷίετ • setTotalCostLimit
• ίετset࣌ʹࣗͰܾΊΔ • setObject:forKey:cost:
Evictionͷ݅ ͍ํ • Կݸ͔ͷΞϧΰϦζϜΛΈ߹Θ͍ͤͯΔΒ͍͠ • جຊతʹLRU (Least Recently Used) Ά͍
• ࠷ޙʹͬͨͷΛ͢ • ίετ or αΠζ্͕ݶΛ͑ͨΒevict
NSCacheͱ࿈ܞ͢ΔΫϥε ͓·͚ • NSDiscardableContent • ഁغՄೳͳσʔλΛදݱ͢Δϓϩτίϧ • ഁغՄೳ͔Λ͍߹ΘͤΔϝιου͕͋Δ • NSPurgeableData
<NSDiscardableContent> • NSMutableDataͷࢠΫϥε
·ͱΊ • ը૾ΩϟογϡʹNSCache • εϨουηʔϑ • লϝϞϦ • LRU