cucumber-js
cucumber-js copied to clipboard
Importing the public cucumber API is slow
🤔 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.
Thanks for reporting @Korijn. We can certainly do some profiling and see where that time is going.
I'm going to take a look at this. No promises.