Upgrade to Pro — share decks privately, control downloads, hide ads and more …

遅延評価と健康

Susisu
October 16, 2016

 遅延評価と健康

遅延評価でパーサコンビネータを高速化した話
http://connpass.com/event/39553/

Susisu

October 16, 2016
Tweet

More Decks by Susisu

Other Decks in Programming

Transcript

  1. ஗ Ԇ ධ Ձ ͱ ݈ ߁ 2 0 1

    6 - 1 0 - 1 6 O U C C LT ձ # 5 @susisu2413
  2. ஗ Ԇ ධ Ձ Ͱ ύ ʔ α ί ϯ

    Ϗω ʔ λ Λ ޮ ཰ Խ ͠ ͨ ࿩ Λ ͠ · ͢
  3. ߏ จ ղ ੳ ͢ Δ ΍ ͭ h t

    t p s : / / e n . w i k i p e d i a . o rg / w i k i / P a r s e r _ c o m b i n a t o r
  4. ೖ ྗ Τ ϥ ʔ ஋ ࢒ Γ ύʔα ύʔαΛؔ਺Ͱදݱ

    ʢ࣮༻্͸ΦϒδΣΫτͰϥοϓʣ
  5. ೖ ྗ Τ ϥ ʔ ஋ ࢒ Γ ύʔα ύ

    ʔ α ύ ʔ α ύʔα ίϯϏωʔλ ύʔαίϯϏωʔλͰΑΓෳࡶͳύʔαΛߏங
  6. ༗ ໊ ͳ ͷ P a r s e c

    ( H a s k e l l ) h t t p s : / / g i t h u b . c o m / a s l a t t e r / p a r s e c P a r s i m m o n ( J a v a S c r i p t ) h t t p s : / / g i t h u b . c o m / j n e e n / p a r s i m m o n
  7. J a v a S c r i p t

    Ͱ P a r s e c ؙ ύ Ϋ Ϧ h t t p s : / / g i t h u b . c o m / s u s i s u / L o q u a t
  8. ͱ ͯ ΋ ศ ར ࣗ ࡞ ε Ϋ Ϧ

    ϓ τ ݴ ޠ G r a s s ί ϯύ Π ϥ ︙
  9. ໿1000ߦͷ JSON × 1000ճ (Node.js v6.7.0) ଎ ౓ ൺ ֱ

    Parsimmon: 4.8 sec PEG.js: 8.47 sec Loquat: 72724ms ࣗ࡞: ? sec
  10. ໿1000ߦͷ JSON × 1000ճ ଎ ౓ ൺ ֱ Parsimmon: 4.8

    sec PEG.js: 8.47 sec ࣗ࡞: 72.7 sec
  11. V 8 ͷ ϓ ϩ ϑ Ν Π ϥ Ͱ

    ௐ ΂ Δ node --prof parse.js node --prof-process isolate-0x*-v8.log https://github.com/v8/v8/wiki/Using%20V8’s %20internal%20profiler
  12. ஗ ͍ ΋ ͷ ͨ ͪ ύ ʔ α ͷ

    ݁ ߹ จ ࣈ ͷ ύ ʔε Τ ϥ ʔ ॲ ཧ
  13. Τ ϥ ʔ ॲ ཧ ߏ จ ղ ੳ ࣦ

    ഊ ࣌ ʹ ώ ϯ τ Λ ग़ ͢ ͨ Ί ϝ ο η ʔ δ ഑ ྻ ͷ ݁ ߹ ͳ Ͳ
  14. Ϋ ϩ ʔ δ ϟ ʹ ͢ Ε ͹ ྑ

    ͍ let x = () => 1 + 2;
  15. ຖ ճ ؔ ਺ ݺ ͼ ग़ ͠ Ω ϟ

    ο γ ϡ ͞ Ε ͳ ͍ ࢖ ͍ ͮ Β ͍
  16. ໿1000ߦͷ JSON × 1000ճ ଎ ౓ ൺ ֱ ݩ: 72.7

    sec վྑ൛: 28.4 sec ஗ԆධՁ͋Γ: ? sec
  17. ໿1000ߦͷ JSON × 1000ճ ଎ ౓ ൺ ֱ Parsimmon: 4.8

    sec PEG.js: 8.47 sec վྑ൛ + ஗ԆධՁ: 11.2 sec
  18. ஗ Ԇ ධ Ձ ͸ ͍ ͍ ͧ ܭ ࢉ

    ͷ ޮ ཰ Խ ଞ ʹ ΋ ॥ ؀ ఆ ٛ ͳ Ͳ
  19. ܽ ఺ ΋ ͋ Δ ͷ Ͱ ஫ ҙ ࣌

    ؒ ɾ ۭ ؒ త ί ε τ ࢥ Θ ͵ ε λ ο Ϋ ͷ ফ අ
  20. ύ ʔ α ί ϯ Ϗω ʔ λ v 2

    ͝ ظ ଴ Լ ͞ ͍ h t t p s : / / g i t h u b . c o m / s u s i s u / l o q u a t - c o re