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

@swc-node/jest を使って テストを高速化する/jsfes-2022

@swc-node/jest を使って テストを高速化する/jsfes-2022

Kenichiro Kishida

July 16, 2022
Tweet

More Decks by Kenichiro Kishida

Other Decks in Technology

Transcript

  1. Նͷ+BWB4DSJQUࡇΓ0OMJOF
    ,FOJDIJSP,JTIJEB
    !TJ[VIJLP
    !TXDOPEFKFTU
    Λ࢖ͬͯ
    ςετΛߴ଎Խ͢Δ

    View full-size slide

  2. ,FOJDIJSP,JTIJEB
    Ӭ࿨ͷσΟεςΟϯάΠογϡτɾΤϯδχΞ੍౓ʹ͓͚Δ
    %JTUJOHVJTIFE$SFBUPS
    TJ[VIJLP!HNBJMDPN !TJ[VIJLP
    IUUQTHJUIVCDPNTJ[VIJLP
    IUUQCMPHPQFOUPLZPKQ

    View full-size slide

  3. https://blog.open.tokyo.jp/2021/07/11/pong-swoosh.html
    PR

    View full-size slide

  4. PR
    ΋͠Α͚Ε͹ࢀՃ͍ͯͩ͘͠͞

    View full-size slide

  5. w5ZQF4DSJQUΛ࢖͍ͬͯΔɺ·ͨ͸͜Ε͔
    Β࢖͓͏ͱࢥ͍ͬͯΔ
    wࣗಈςετΛॻ͍͍ͯΔɺ·ͨ͸͜Ε͔Β
    ॻ͘༧ఆͰ͋Δ
    w$*ͷ͕͔͔͍࣌ؒͬͯΔɺ·ͨ͸΋ͬͱ଎
    ͍ͨ͘͠ͱࢥ͍ͬͯΔ
    ຊ೔ͷλʔήοτϢʔβʔ

    View full-size slide

  6. ܕνΣοΫʜ

    View full-size slide

  7. TypeScript Jest ߴ଎Խ

    View full-size slide

  8. w(PͰ࣮૷͞Ε͍ͯΔ
    wϑϩϯτΤϯυ։ൃͰ࢖ΘΕΔ͜ͱ͕ଟ͍
    w7JUFͰ࢖ΘΕ͍ͯΔ
    wσίϨʔλ͕࢖͑ͳ͍
    FTCVJME

    View full-size slide

  9. w3VTUͰ࣮૷͞Ε͍ͯΔ
    w%FOPͰ࢖ΘΕ͍ͯΔ
    wσίϨʔλ͕࢖͑Δ
    48$

    View full-size slide

  10. ๻ͨͪ͸ʜ
    wNJDSPTPGUUTZSJOHF
    w5ZQF03.

    View full-size slide

  11. @swc-node/core @swc-node/jest
    tscon
    fi
    g
    .swcrc
    transformer

    View full-size slide

  12. transformSync
    :


    esbuild x 510 ops/sec ±1.28% (88 runs sampled
    )

    @swc-node/core x 438 ops/sec ±1.00% (88 runs sampled
    )

    typescript x 28.83 ops/sec ±10.20% (52 runs sampled
    )

    babel x 24.21 ops/sec ±10.66% (46 runs sampled
    )

    Transform rxjs/AjaxObservable.ts benchmark bench suite: Fastest is esbuil
    d

    transform paralle
    l

    @swc-node/core x 1,253 ops/sec ±0.90% (75 runs sampled
    )

    esbuild x 914 ops/sec ±1.31% (77 runs sampled
    )

    Transform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/cor
    e

    yarn benc
    h

    @swc-node/core x 1,123 ops/sec ±0.95% (77 runs sampled
    )

    esbuild x 847 ops/sec ±3.74% (71 runs sampled
    )

    Transform rxjs/AjaxObservable.ts parallel benchmark bench suite: Fastest is @swc-node/cor
    https://github.com/swc-project/swc-node

    View full-size slide

  13. w5ZQF4DSJQUͷςετ͸଎͘ͳΔ
    wσίϨʔλΛ࢖͍ͬͯΔͳΒ48$Ұ୒
    w!TXDOPEFΛ࢖͏ͱUTDPO
    fi
    Hͷઃఆ
    ͚ͩͰྑ͍
    wUTDͰͷίϯύΠϧνΣοΫ͸๨Εͣʹ
    wৄ͘͠͸ϒϩάͰ
    ·ͱΊ

    View full-size slide

  14. https://blog.open.tokyo.jp/

    View full-size slide