babel-registerを高速化した話

 babel-registerを高速化した話

#tng21 で発表した babel-register を高速化した話です。

D76231a2114896dfcc7b79ac69558b79?s=128

Yosuke Furukawa

June 30, 2016
Tweet

Transcript

  1. babel-registerΛߴ଎ Խͨ͠࿩ @yosuke_furukawa

  2. Eater

  3. Eater URL https://github.com/yosuke-furukawa/eater

  4. - Eater features - Multi-process Easy Mock Happy Async

  5. Eater ձࣾͰ࢖ͬͯͯ·͊·͊ ͍͍ײ͡ʹͳͬͯΔɻ koichik͔ΒPR΋Β͏ͷخ͍͠

  6. babel-register

  7. babel-register

  8. But …. • Eater x babel ؀ڥͩͱ • Eater ͕ͨ͘͞Μ

    process ্͛ͯͦͷ౓ʹ babel ͷ transpile ͕૸Δ • babel-register ͸଎౓޲্ͷͨΊʹtranspileޙͷ ݁ՌΛΩϟογϡ͍ͯ͠Δ͕ɺ multiprocess Ͱಈ ͘͜ͱΛߟྀ͍ͯ͠ͳ͍
  9. active-cache-babel-register

  10. DEMO

  11. ࢓૊Έ TUDBDIF CBCFMKTPO CBCFMSFHJTUFS

  12. ࢓૊Έ (babel-register) CBCFMKTPO CBCFMSFHJTUFS babelࡁΈͷ݁Ռ͸ϝϞϦதʹ͓͍࣋ͬͯͯ ϓϩηε͕ऴΘͬͨΒ .babel.json ʹग़ྗ͢Δ

  13. ࢓૊Έ (active-cache-babel-register) TUDBDIF CBCFMKTPO OEDBDIF CBCFM@BDUJWF BDUJWFDBDIFCBCFMSFHJTUFS 1st cache ͷ

    babel.json ʹώοτ͠ ͳ͔ͬͨΒ 2nd cache Λݟʹߦ͘
  14. ࢓૊Έ (active-cache-babel-register) TUDBDIF CBCFMKTPO OEDBDIF CBCFM@BDUJWF BDUJWFDBDIFCBCFMSFHJTUFS 2nd cache ͸

    multi-process ؒ ͰγΣΞՄೳͳܗࣜ
  15. ࢓૊Έ (active-cache-babel-register) TUDBDIF CBCFMKTPO OEDBDIF CBCFM@BDUJWF BDUJWFDBDIFCBCFMSFHJTUFS ͞ΒʹઃఆϑΝΠϧͷมߋ༗ແ·Ͱ ݟΔͷͰɺ ແବͳ

    require Λճආ
  16. Happy Eater https://github.com/yosuke- furukawa/eater

  17. with active-cache-babel- register https://github.com/yosuke- furukawa/active-cache- babel-register