Skip to content

Jest performance is at best 2x slower than Jasmine, in our case 7x slower #6694

Open
@EvHaus

Description

@EvHaus

🐛 Bug Report

We've been using Jest alongside Jasmine for the same test suite for about a year now. We love Jest because it's developer experience is superb, however, on our very large monorepo with ~7000+ test specs, Jest runs about 7 times slower than Jasmine. This problem has been getting worse and worse as the test suite grows and as a result, we always run our test suite via Jasmine and only use Jest for development --watch mode.

We would ♥ to use Jest as our only test runner, but its poor performance is preventing us from doing so. Having to run both Jest and Jasmine runners requires painful CI setup and constant upkeep of the Jasmine environment setup (which is much more complex than Jest's).

I'd like to better understand why the performance difference is so significant and if there's anything that can be done to optimize it.

To Reproduce

I've created a very detailed project to reproduce and profile both Jest and Jasmine on the same test suite in this project: https://github.com/EvHaus/jest-vs-jasmine

The environment is the same. The configurations are very similar. Both use JSDom. Both use the same Babel setup. Additional instructions are contained therein.

Expected behavior

Running tests through Jest should ideally be as fast as running them through Jasmine.

Link to repl or repo (highly encouraged)

https://github.com/EvHaus/jest-vs-jasmine

Run npx envinfo --preset jest

Tested on a few different platform. See https://github.com/EvHaus/jest-vs-jasmine README for more info.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions