jsconf.eu x Node Collaborators Meetup journey
by
Yosuke Furukawa
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Node Collaborators Meetup & JSConf.EU 2017/06/28 NodeֶԂ 26
Slide 2
Slide 2 text
No content
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
໘ന͔ͬͨ 3ͭհ
Slide 6
Slide 6 text
1. How to save
Slide 7
Slide 7 text
2017ݱࡏɺύεϫʔυΛͲ ͏ͬͯ҆શʹอଘ͢Δ͔
Slide 8
Slide 8 text
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ฏจͰอଘͯ͠ΔΑʔͬͯ ਓʁʁʁ
Slide 9
Slide 9 text
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ฏจͰอଘͯ͠ΔΑʔͬͯ ਓʁʁʁ ࢮܐ
Slide 10
Slide 10 text
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ͪΌʔΜͱϋογϡԽͯ͠· ͢Αʔʂ md5 Ͱʂʂʂʂ
Slide 11
Slide 11 text
ύεϫʔυͲ͏ͬͯอଘ͠ ͯ·͔͢ʁ ͪΌʔΜͱϋογϡԽͯ͠· ͢Αʔʂ md5 Ͱʂʂʂʂ ࢮܐ
Slide 12
Slide 12 text
Ͱਖ਼ʹݴͬͯʁ ͜ΕͬͪΌͬͨ͜ͱ͋Δਓ ͍ͳ͍ʁʁʁ
Slide 13
Slide 13 text
Ͱ͢Ͷʂʂʂʂʂ (ϗϏʔϓϩδΣΫτ)
Slide 14
Slide 14 text
͜ΕΒͷϋογϡؔ ύεϫʔυϋογϡͱͯ͠ ;͞Θ͘͠ͳ͍ md5/sha1/sha256
Slide 15
Slide 15 text
ύεϫʔυอଘ͢Δ࣌ͷ ϋογϡؔ ҉߸తϋογϡؔͱ ݺΕΔͷ bcrypt/pbkdf2/scrypt
Slide 16
Slide 16 text
CDSZQUJTTUJMMTFDVSFJO CVUBSHPOXPOJO1BTTXPSE )BTI$POUFTU
Slide 17
Slide 17 text
҉߸తϋογϡؔฒྻ࣮ ߦՄೳͳճ࿏ͰҰؾʹԋࢉ͞ ΕΔͱղಡͰ͖ͪΌ͏͔ʁ (Ex: GPU, FPGA)
Slide 18
Slide 18 text
ͦ͜Ͱ Argon2 Password Hash Competition Ͱ༏উͨ͠ϋογϡؔɺ ݱࡏ࠷ڧ?ͷͣɻ
Slide 19
Slide 19 text
Α͘Θ͔Βͳ͔ͬͨͬͯਓʁ
Slide 20
Slide 20 text
҆৺ͯ͠Լ͍͞ʂʂʂ
Slide 21
Slide 21 text
OQNJTFDVSFQBTTXPSE ͜Ε͚֮ͩ͑ͯΕ͍͍Ͱ͢ʂ
Slide 22
Slide 22 text
No content
Slide 23
Slide 23 text
JavaScript͕Ͳ͏ͬͯಈ͍ ͍ͯΔ͔ͱ͍͏
Slide 24
Slide 24 text
ͦͦJavaScriptͬͯͲ͏ಈ ͍ͯΔͷʁ தC++Ͱbytecodeੜͯͨ͠Γ͢Δ
Slide 25
Slide 25 text
JIT (Hidden Class) 0QUJNJ[BUJPOͱݺͿ
Slide 26
Slide 26 text
ͨͩ͠ var obj = { x: 1, y: 2, }; // obj ͷ y propΛফ͢ delete obj.y; // obj ʹ z propΛ͢ obj.z = 3; // obj ͷ props Λ֬ೝ͢Δ obj.hasOwnProperties ͜͏͍͏͜ͱΔͱ͍
Slide 27
Slide 27 text
ͨͩ͠ var obj = { x: 1, y: 2, }; // obj ͷ y propΛফ͢ delete obj.y; // obj ʹ z propΛ͢ obj.z = 3; // obj ͷ props Λ֬ೝ͢Δ obj.hasOwnProperties ͜͏͍͏͜ͱΔͱ͍ ͜ΕΛ%FPQUJNJ[BUJPOͱݺͿ
Slide 28
Slide 28 text
JSͷதͷಈ͖ɹ
Slide 29
Slide 29 text
V8͜͏
Slide 30
Slide 30 text
V8͜͏
Slide 31
Slide 31 text
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});
Slide 32
Slide 32 text
͋ͱ։ൃऀ͚ʹ͜ͷΦϓγϣ ϯΛ͓͑ͯ͘ͱΠφϑ
Slide 33
Slide 33 text
OK͜ΕͰɺJSͷίʔυΑ ΓߴʹͳΔͣɻ
Slide 34
Slide 34 text
Ͱɾɾɾ
Slide 35
Slide 35 text
ࠓޙʹͳͬͯ͘Δॴ
Slide 36
Slide 36 text
Parseॲཧ
Slide 37
Slide 37 text
Parseॲཧ
Slide 38
Slide 38 text
Parseॲཧ • ParseॲཧͷతͰ͖Δ͚ͩૣ͘จ๏Τϥʔ Λ͑ͯASTʹม͢Δ͜ͱ
Slide 39
Slide 39 text
Parseॲཧ • v8ͷParser࣮2ͭ͋Δ • Eager Parser: • ίϯύΠϧ͍ͨ͠શͯͷؔΛύʔε͢ΔͨΊʹΘΕΔ • AST ߏங͕ϝΠϯλεΫ • JSͷscopeΛߏங͠ɺESSpecʹԊͬͨશͯͷsyntaxΤϥʔΛݟ͚ͭΔ • Lazy Parser: • ίϯύΠϧͨ͘͠ͳ͍ؔͷύʔεΛεΩοϓ͢ΔͨΊʹΘΕΔ • ASTߏங͠ͳ͍ • அՄೳͳsyntaxΤϥʔͷΈݟ͚ͭΔɺESspecʹඞͣ͠ԊΘͳ͍
Slide 40
Slide 40 text
Parseॲཧ • ʮॳظஈ֊Ͱ Lazy Parser ʹࣄͤͯ͞ޙʹ Eager Parser ʹࣄͤ͞Δʯͱ͍͏উෛ • Lazy Parse ͢Δͷ͔ Eager Parse ͢Δͷ͔ V8 ͷؾ ࣍ୈͰܾ·Δͷ͕ଟ͍(Heuristic) • ຊʹStartup࣌ʹඞཁͳͷ͚ͩEager Parseͤ͞ ͯɺଞLazy Parse ͍ͤͨ͞
Slide 41
Slide 41 text
Optimize.js • https://github.com/nolanlawson/optimize-js • optimize.js ͜ͷ Eager Parse Λແཧཧ Lazy Parseʹ͢ΔͨΊͷtranspiled optimizer
Slide 42
Slide 42 text
Optimize.js ͜Μͳײ͡Ͱແཧཧ-B[Z 1BSTFͤ͞ΔͨΊͷ ώϯτΛ༩͑Δ
Slide 43
Slide 43 text
Α͘Θ͔Βͳ͔ͬͨͬͯਓʁ
Slide 44
Slide 44 text
҆৺ͯ͠Լ͍͞ʂʂʂ
Slide 45
Slide 45 text
͜Ε͚֮ͩ͑ͯԼ͍͞ʂ Chrome/Nodeࠓޙͬͱ ͘ͳΔʂ Optimize.js ͏ͱͬͱ ͬͱ͘ͳΔ(͔)ʂ
Slide 46
Slide 46 text
Node Collaborators Summit
Slide 47
Slide 47 text
No content
Slide 48
Slide 48 text
Node.js ͷίϥϘϨʔλ͕Ұ ಉʹհͯ͠coreͷ࡞ۀΛߦͬ ͨΓɺٞ͢Δॴ
Slide 49
Slide 49 text
http2, promise, stream, etc
Slide 50
Slide 50 text
͜Μͳײ͡ͷՌɺͪͳΈʹIUUQ/PEFશવಈ͔ͳ͍ͷͰɺ ͪΌΜͱಈ͔ͤΔͷʹ͍͖ͯ͠·͢ ʆŋТŋ ʎ
Slide 51
Slide 51 text
·ͱΊ • jsconf.eu࠷ߴͰͨ͠ • ΈΜͳReactͱ͔Angularͱ͔ͦ͏͍͏ͯ͠ͳ͍ • Ͳ͔ͬͪͱ͍͏ͱJSͱ͍͏ΩʔϫʔυͷԞʹ͋ΔϨΠϠʔͳ ෦ͩͬͨΓɺΣϒ͚ͩͰͳ͍ผͷΛղܾ͍ͯͨ͠Γ • Node Collaborators Meetup࠷ߴͰͨ͠ • Node.js http2 ͍ͬͯͧ͘ʂʂʂʂʂ
Slide 52
Slide 52 text
࣍Node InteractiveͰ ൃද͢Δ༧ఆͰ͢ɻ
Slide 53
Slide 53 text
͋Γ͕ͱ͏͍͟͝·ͨ͠