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
jsconf.eu x Node Collaborators Meetup journey
Search
Yosuke Furukawa
PRO
June 28, 2017
Programming
0
1.8k
jsconf.eu x Node Collaborators Meetup journey
東京Node学園26時限目で飛び入りLTで発表した資料です。
Yosuke Furukawa
PRO
June 28, 2017
Tweet
Share
More Decks by Yosuke Furukawa
See All by Yosuke Furukawa
tc39 x jsconf.jp Panel Discussion 2024
yosuke_furukawa
PRO
0
150
Removing Corepack
yosuke_furukawa
PRO
9
1.3k
JavaScript Runtime とはなにか
yosuke_furukawa
PRO
15
2.5k
Strip Types と Storage
yosuke_furukawa
PRO
4
340
Module Harmony について
yosuke_furukawa
PRO
3
1.5k
LTのやり方
yosuke_furukawa
PRO
16
2.2k
AppRouter Panel Talk
yosuke_furukawa
PRO
3
700
Node.js v22 で変わること
yosuke_furukawa
PRO
13
5.3k
リアーキテクトと開発生産性について
yosuke_furukawa
PRO
25
9.6k
Other Decks in Programming
See All in Programming
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
Quine, Polyglot, 良いコード
qnighy
4
640
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
受け取る人から提供する人になるということ
little_rubyist
0
230
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
Jakarta EE meets AI
ivargrimstad
0
200
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
180
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Featured
See All Featured
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
What's in a price? How to price your products and services
michaelherold
243
12k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Faster Mobile Websites
deanohume
305
30k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Music & Morning Musume
bryan
46
6.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Adopting Sorbet at Scale
ufuk
73
9.1k
Transcript
Node Collaborators Meetup & JSConf.EU 2017/06/28 NodeֶԂ 26
None
None
None
໘ന͔ͬͨ 3ͭհ
1. How to save
2017ݱࡏɺύεϫʔυΛͲ ͏ͬͯ҆શʹอଘ͢Δ͔
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ฏจͰอଘͯ͠ΔΑʔͬͯ ਓʁʁʁ
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ฏจͰอଘͯ͠ΔΑʔͬͯ ਓʁʁʁ ࢮܐ
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ͪΌʔΜͱϋογϡԽͯ͠· ͢Αʔʂ md5 Ͱʂʂʂʂ
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ͪΌʔΜͱϋογϡԽͯ͠· ͢Αʔʂ md5 Ͱʂʂʂʂ ࢮܐ
Ͱਖ਼ʹݴͬͯʁ ͜ΕͬͪΌͬͨ͜ͱ͋Δਓ ͍ͳ͍ʁʁʁ
Ͱ͢Ͷʂʂʂʂʂ (ϗϏʔϓϩδΣΫτ)
͜ΕΒͷϋογϡؔ ύεϫʔυϋογϡͱͯ͠ ;͞Θ͘͠ͳ͍ md5/sha1/sha256
ύεϫʔυอଘ͢Δ࣌ͷ ϋογϡؔ ҉߸తϋογϡؔͱ ݺΕΔͷ bcrypt/pbkdf2/scrypt
CDSZQUJTTUJMMTFDVSFJO CVUBSHPOXPOJO1BTTXPSE )BTI$POUFTU
҉߸తϋογϡؔฒྻ࣮ ߦՄೳͳճ࿏ͰҰؾʹԋࢉ͞ ΕΔͱղಡͰ͖ͪΌ͏͔ʁ (Ex: GPU, FPGA)
ͦ͜Ͱ Argon2 Password Hash Competition Ͱ༏উͨ͠ϋογϡؔɺ ݱࡏ࠷ڧ?ͷͣɻ
Α͘Θ͔Βͳ͔ͬͨͬͯਓʁ
҆৺ͯ͠Լ͍͞ʂʂʂ
OQNJTFDVSFQBTTXPSE ͜Ε͚֮ͩ͑ͯΕ͍͍Ͱ͢ʂ
None
JavaScript͕Ͳ͏ͬͯಈ͍ ͍ͯΔ͔ͱ͍͏
ͦͦJavaScriptͬͯͲ͏ಈ ͍ͯΔͷʁ தC++Ͱbytecodeੜͯͨ͠Γ͢Δ
JIT (Hidden Class) 0QUJNJ[BUJPOͱݺͿ
ͨͩ͠ var obj = { x: 1, y: 2, };
// obj ͷ y propΛফ͢ delete obj.y; // obj ʹ z propΛ͢ obj.z = 3; // obj ͷ props Λ֬ೝ͢Δ obj.hasOwnProperties ͜͏͍͏͜ͱΔͱ͍
ͨͩ͠ var obj = { x: 1, y: 2, };
// obj ͷ y propΛফ͢ delete obj.y; // obj ʹ z propΛ͢ obj.z = 3; // obj ͷ props Λ֬ೝ͢Δ obj.hasOwnProperties ͜͏͍͏͜ͱΔͱ͍ ͜ΕΛ%FPQUJNJ[BUJPOͱݺͿ
JSͷதͷಈ͖ɹ
V8͜͏
V8͜͏
DEMO function deopt(obj) { return obj.x; } for (var i
= 0; i < 1000000; i++) { deopt({ x: 1, y: 2}); } // deoptimized… deopt({ x: 1, y: 2, z: 3});
͋ͱ։ൃऀ͚ʹ͜ͷΦϓγϣ ϯΛ͓͑ͯ͘ͱΠφϑ
OK͜ΕͰɺJSͷίʔυΑ ΓߴʹͳΔͣɻ
Ͱɾɾɾ
ࠓޙʹͳͬͯ͘Δॴ
Parseॲཧ
Parseॲཧ
Parseॲཧ • ParseॲཧͷతͰ͖Δ͚ͩૣ͘จ๏Τϥʔ Λ͑ͯASTʹม͢Δ͜ͱ
Parseॲཧ • v8ͷParser࣮2ͭ͋Δ • Eager Parser: • ίϯύΠϧ͍ͨ͠શͯͷؔΛύʔε͢ΔͨΊʹΘΕΔ • AST
ߏங͕ϝΠϯλεΫ • JSͷscopeΛߏங͠ɺESSpecʹԊͬͨશͯͷsyntaxΤϥʔΛݟ͚ͭΔ • Lazy Parser: • ίϯύΠϧͨ͘͠ͳ͍ؔͷύʔεΛεΩοϓ͢ΔͨΊʹΘΕΔ • ASTߏங͠ͳ͍ • அՄೳͳsyntaxΤϥʔͷΈݟ͚ͭΔɺESspecʹඞͣ͠ԊΘͳ͍
Parseॲཧ • ʮॳظஈ֊Ͱ Lazy Parser ʹࣄͤͯ͞ޙʹ Eager Parser ʹࣄͤ͞Δʯͱ͍͏উෛ •
Lazy Parse ͢Δͷ͔ Eager Parse ͢Δͷ͔ V8 ͷؾ ࣍ୈͰܾ·Δͷ͕ଟ͍(Heuristic) • ຊʹStartup࣌ʹඞཁͳͷ͚ͩEager Parseͤ͞ ͯɺଞLazy Parse ͍ͤͨ͞
Optimize.js • https://github.com/nolanlawson/optimize-js • optimize.js ͜ͷ Eager Parse Λແཧཧ Lazy
Parseʹ͢ΔͨΊͷtranspiled optimizer
Optimize.js ͜Μͳײ͡Ͱແཧཧ-B[Z 1BSTFͤ͞ΔͨΊͷ ώϯτΛ༩͑Δ
Α͘Θ͔Βͳ͔ͬͨͬͯਓʁ
҆৺ͯ͠Լ͍͞ʂʂʂ
͜Ε͚֮ͩ͑ͯԼ͍͞ʂ Chrome/Nodeࠓޙͬͱ ͘ͳΔʂ Optimize.js ͏ͱͬͱ ͬͱ͘ͳΔ(͔)ʂ
Node Collaborators Summit
None
Node.js ͷίϥϘϨʔλ͕Ұ ಉʹհͯ͠coreͷ࡞ۀΛߦͬ ͨΓɺٞ͢Δॴ
http2, promise, stream, etc
͜Μͳײ͡ͷՌɺͪͳΈʹIUUQ/PEFશવಈ͔ͳ͍ͷͰɺ ͪΌΜͱಈ͔ͤΔͷʹ͍͖ͯ͠·͢ ʆŋТŋ ʎ
·ͱΊ • jsconf.eu࠷ߴͰͨ͠ • ΈΜͳReactͱ͔Angularͱ͔ͦ͏͍͏ͯ͠ͳ͍ • Ͳ͔ͬͪͱ͍͏ͱJSͱ͍͏ΩʔϫʔυͷԞʹ͋ΔϨΠϠʔͳ ෦ͩͬͨΓɺΣϒ͚ͩͰͳ͍ผͷΛղܾ͍ͯͨ͠Γ • Node
Collaborators Meetup࠷ߴͰͨ͠ • Node.js http2 ͍ͬͯͧ͘ʂʂʂʂʂ
࣍Node InteractiveͰ ൃද͢Δ༧ఆͰ͢ɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠