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

͋Γ͕ͱ͏͍͟͝·ͨ͠