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

contentful --help took 36 sec #2681

Open
lkurzyniec opened this issue Jul 4, 2024 · 1 comment
Open

contentful --help took 36 sec #2681

lkurzyniec opened this issue Jul 4, 2024 · 1 comment

Comments

@lkurzyniec
Copy link

Execution of any basic commands, like -v or --help, is taking longer than 30 sec.

Expected Behavior

Response should be immediate.

Actual Behavior

image

Context

I'm not logged in.

Environment

  • Node: v22.4.0
  • NPM: 10.8.1
  • Operating System: Linux 5.15.153.1-microsoft-standard-WSL2 Refactor/upgrades #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Package Version: 3.3.3
@0x1ad2
Copy link

0x1ad2 commented Jan 15, 2025

Hi @lkurzyniec,

I've conducted some benchmarks using a similar environment to yours, and the results suggest that the issue might not stem directly from the Contentful CLI. Here's what I found:

Benchmarks

I ran hyperfine to measure the execution time of the contentful --help command in your environment, e.g. hyperfine --warmup 1 --runs 10 'contentful --help'

Run 1

  • Node: v22.4.0
  • NPM: 10.8.1
Benchmark 1: contentful --help
Time (mean ± σ): 252.3 ms ± 2.5 ms [User: 243.4 ms, System: 45.7 ms]
Range (min … max): 249.7 ms … 257.7 ms  10 runs

Run 2

  • Node: v23.5.0
  • NPM: 11.0.0
Benchmark 1: contentful --help
  Time (mean ± σ):     281.0 ms ±   2.0 ms    [User: 271.8 ms, System: 53.1 ms]
  Range (min … max):   279.1 ms … 285.2 ms    10 runs

Using a newer setup (Node v23.5.0, NPM 11.0.0), I observed slightly higher execution times, but nothing close to the 30+ seconds delay you're reporting.


Further Troubleshooting

  1. Network Influence: Could your WSL2 environment be experiencing networking issues? Sometimes, CLI commands check for updates or dependencies that require internet access. You might try running the command offline (e.g., disconnect from the network) to confirm this.

  2. Filesystem Performance: WSL2 occasionally suffers from filesystem latency. Does the issue persist if you run the CLI in a non-WSL Linux environment or directly on a physical Linux machine?

  3. Global Dependencies: Ensure no conflicting or outdated global dependencies are interfering. A clean installation of Node/NPM with a fresh global setup might help isolate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants