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

Importing the public cucumber API is slow #2115

Open
Korijn opened this issue Aug 15, 2022 · 2 comments
Open

Importing the public cucumber API is slow #2115

Korijn opened this issue Aug 15, 2022 · 2 comments
Labels
🏦 debt Tech debt 🐛 bug Defect / Bug

Comments

@Korijn
Copy link

Korijn commented Aug 15, 2022

🤔 What's the problem you're trying to solve?

Importing @cucumber/cucumber in test setup or step modules (ES modules) takes about 4 seconds. That's waiting time before the test suite begins to run.

import { Given, When, Then } from '@cucumber/cucumber'

When I run cucumber-js as a subprocess with blank config and no step/setup code, it takes about 400 ms to exit. When I import just a single module that imports @cucumber/cucumber the time jumps up to approximately 4.4 secs.

✨ What's your proposed solution?

Is it possible to restructure the library such that the public API (hooks and step definers) can be imported without also importing every other module in cucumber? I guess that should reduce the import footprint by a lot!

⛏ Have you considered any alternatives or workarounds?

N/A

📚 Any additional context?

I'm running this on a high powered machine with an NVME SSD, so I doubt it's my machine that's slowing this down.

@Korijn Korijn changed the title Imports slow Importing the public cucumber API is slow Aug 15, 2022
@davidjgoss davidjgoss added 🐛 bug Defect / Bug 🏦 debt Tech debt labels Aug 15, 2022
@davidjgoss
Copy link
Contributor

Thanks for reporting @Korijn. We can certainly do some profiling and see where that time is going.

@michael-lloyd-morris
Copy link
Contributor

I'm going to take a look at this. No promises.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏦 debt Tech debt 🐛 bug Defect / Bug
Projects
None yet
Development

No branches or pull requests

3 participants