Submit Search
javascriptのデータ構造の話
3 likes
3,608 views
Taketoshi 青野健利
javascriptのデータ構造の特徴・使い所・パフォーマンスの話
Engineering
Read more
1 of 29
Download now
Download to read offline
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
More Related Content
PDF
Updates on webSpoon and other innovations from Hitachi R&D
Hiromu Hota
PPTX
私はこうやってSlackを社内で流行らせました
NHN テコラス株式会社
PDF
ServiceWorkerとES6 Modules時代のTypescript開発考察
Taketoshi 青野健利
PDF
V8 javascript engine for フロントエンドデベロッパー
Taketoshi 青野健利
PDF
非同期javascriptの過去と未来
Taketoshi 青野健利
PDF
仮想DOMの実装とパフォーマンス
Taketoshi 青野健利
PDF
JavascriptのGC入門
Taketoshi 青野健利
PDF
V8 Iginition Interpreter
Taketoshi 青野健利
Updates on webSpoon and other innovations from Hitachi R&D
Hiromu Hota
私はこうやってSlackを社内で流行らせました
NHN テコラス株式会社
ServiceWorkerとES6 Modules時代のTypescript開発考察
Taketoshi 青野健利
V8 javascript engine for フロントエンドデベロッパー
Taketoshi 青野健利
非同期javascriptの過去と未来
Taketoshi 青野健利
仮想DOMの実装とパフォーマンス
Taketoshi 青野健利
JavascriptのGC入門
Taketoshi 青野健利
V8 Iginition Interpreter
Taketoshi 青野健利
Featured
(20)
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
PDF
2024 State of Marketing Report – by Hubspot
Marius Sescu
PDF
Everything You Need To Know About ChatGPT
Expeed Software
PDF
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
PDF
Skeleton Culture Code
Skeleton Technologies
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
PDF
Content Methodology: A Best Practices Report (Webinar)
contently
PPTX
How to Prepare For a Successful Job Search for 2024
Albert Qian
PDF
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
PDF
5 Public speaking tips from TED - Visualized summary
SpeakerHub
PDF
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
PDF
Getting into the tech field. what next
Tessa Mero
PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
PDF
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
2024 Trend Updates: What Really Works In SEO & Content Marketing
Search Engine Journal
Storytelling For The Web: Integrate Storytelling in your Design Process
Chiara Aliotta
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
OECD Directorate for Financial and Enterprise Affairs
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
SocialHRCamp
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Ad
javascriptのデータ構造の話
1.
jjaavvaassccrriipptt DDaattaa SSttrruuccttuurreess
2.
: @brn (
a.k.a ) : : Cyberagent RightSegment AI Messenger : http://abcdef.gets.b6n.ch/ Twitter: https://twitter.com/brn227 GitHub: https://github.com/brn
3.
Why? javascript • •
•
4.
• => Array •
=> Object • => Object • Set => Object • Object Map Set => Map Set • Iterator => Object.keys • Object => WeakMap • Object => WeakMap • => TypedArray • => DataSet
5.
Array PPrrooss • • CCoonnss •
•
6.
Array javascript • •
•
7.
Object PPrrooss • • •
• CCoonnss •
8.
Object var likeArray = {length: 1, 0: 'a'} length
9.
Object • • length
10.
ArrayBuffer ArrayBufferView ArrayBuffer TypedArray
DataView view TypedArray Uint**Array Int**Array Unsigned Signed 8 32 DataView View
11.
const u32Arr =
new Uint32Array(new ArrayBuffer(1024));! // ArrayBufferの第一引数はバイト数、実際の要素数はViewのバイト数で割った数 // 32bitなら1024 / 4で256要素格納可能 u32Arr[0] = 1; // ここでは0byteオフセット byteLength = 0 && length = 0! u32Arr[1] = 1; // ここでは4byteオフセット byteLength = 4 && length = 1! ! const dv = new DataView(new ArrayBuffer(1024));! dv.setUint8(2, 1); // Uint8の値を2byteオフセットの位置に書き込む! dv.setInt32(0, 1); // Int32の値を4byteオフセットの位置に書き込む
12.
ArrayBuffer ArrayBufferView • •
( )
13.
Map Java Map PPrrooss •
• iterator CCoonnss • •
14.
Map • •
15.
Set Java Set Map
PPrrooss • • iterator CCoonnss • •
16.
Set • •
17.
WeakMap GC PPrrooss • •
CCoonnss • •
18.
WeakMap •
19.
WeakSet WeakMap Set
20.
Be better … Javascript
Object Object javascript
21.
// より防御的なデータ構造 Object.freeze({}); //
webのマナーではないれども... Object.defineProperty(arr, 'length', {! writable: false,! value: arr.length! }); // lengthを固定!
22.
Abstraction ☓ data.something = 100; // ○ data.setSomething(100); // ○ interface Data {something: number} // typescript
23.
Performance javascript
24.
Performance TypedArray Firefox Safari
Chrome IE/Edge
25.
0 10 20 30 40 50 60 70 80 90 100 Chrom Safari Firefox Edge Performance 100% (2017/06/06) http://jsben.ch/#/hohWB
26.
Performance • Map •
Map WeakMap • • Safari • Edge
27.
Result • => Array •
=> Object • => Object • Set => Object • Object Map Set => Map Set • Iterator => Object.keys • Object => WeakMap • Object => WeakMap • => TypedArray • => DataSet
28.
Summary …
Download