bahmutov / add-typescript-to-cypress

Quickly adds TypeScript spec support to Cypress
https://github.com/bahmutov/test-add-typescript-to-cypress
107 stars 6 forks source link

Performance suffers from having many .spec.ts files #17

Open Aali13265 opened 6 years ago

Aali13265 commented 6 years ago

Not sure if this belongs here or in @cypress/webpack-preprocessor;

Since each Typescript file is compiled separately, memory usage and compile time grows quickly when using many .spec.ts files. Moving all tests into one file (or importing all spec files into one) makes a huge difference.

In our project, total run time of cypress run is 60 seconds with one .spec.ts file, 90 seconds when the same tests are split into 8 files. Memory usage is over 1 GB with 8 different files, with one file it stays at 350 MB.

Moving all tests into one file is obviously not ideal, importing multiple files into one is slightly better but still not great. Perhaps this could be done behind the scenes by the preprocessor?

warpdesign commented 4 years ago

I am having performance problems as well:

I'll try to move my tests into a single file to see if it improves the performance.