LedgerHQ/ledger-live-common

cli would be faster if it was bundled in one file

gre opened this issue · 3 comments

gre commented

a quick analysis running node --cpu-prof --heap-prof cli/lib/cli.js sync shows that module loading takes roughtly 1s, maybe because fs/require time.

We could try https://github.com/zeit/ncc 🤔

gre commented

Capture d’écran 2020-01-29 à 21 00 48

seems like we can gain 1s yeah. it's probably worth having it in prepublish script then and change the entry point to that dist (and ultimately cli.js can be dropped).

gre commented

ok this was not accurate. we're more on a 40% gain. still good.

before

Capture d’écran 2020-01-29 à 21 08 06

after
Capture d’écran 2020-01-29 à 21 07 32