Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI performance (long startup time) due to ESM #19

Open
thomvaill opened this issue Jan 20, 2021 · 3 comments
Open

CLI performance (long startup time) due to ESM #19

thomvaill opened this issue Jan 20, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@thomvaill
Copy link
Owner

Bug Report

Description

For any call to the CLI, there is a constant startup time of ~3 sec, whatever the command is. Even a very simple one like log4brains --version.
After a quick debug, it looks like this is due to esm package we use to provide on-the-fly ESM imports capabilities.
My doubts are reinforced by this issue: standard-things/esm#844

Steps to reproduce

log4brains --version

Expected Behavior

log4brains --version (and the majority of other commands) should be instant.

Possible Solution

Either fix the esm package or get rid of it by compiling to commonJS all of our packages... (like the core one).

@thomvaill thomvaill added the bug Something isn't working label Jan 20, 2021
@thomvaill thomvaill changed the title CLI long startup due to ESM CLI performance (long startup time) due to ESM Jan 20, 2021
@creinig
Copy link

creinig commented May 4, 2022

The problem is even more pronounced here (8+s, see below), making the tool almost unusable.
How much effort would it be to fix this? I unfortunately have only minimal JS/TS knowledge.

❯ time log4brains --version
1.0.0-beta.11
log4brains --version  8,42s user 0,60s system 139% cpu 6,460 total

❯ node --version
v16.15.0

❯ cat /etc/lsb-release     
  DISTRIB_ID=Ubuntu
  DISTRIB_RELEASE=20.04
  DISTRIB_CODENAME=focal
  DISTRIB_DESCRIPTION="Ubuntu 20.04.4 LTS"
  • Hardware: ryzen7 4800h, 32G RAM, M.2 SSD
  • nodejs installed as snap

@ghandic
Copy link

ghandic commented May 14, 2022

The performance is terrible... This should be wicked fast as its not doing a lot... Any progress on this?

@creinig
Copy link

creinig commented Jun 7, 2022

Note: The last commit on standard-things/esm was on 26 Sep 2019, so I'm quite pessimistic that esm will be fixed any time soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants