-
Notifications
You must be signed in to change notification settings - Fork 19
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
Possible performance improvement: Generate messages only if assertions fail #295
Comments
I have tested earl on some large project. Quick testing the @dhardtke idea shows at least 50% better execution time on CPU snapshot shows that most time is consumed by |
I've created a pull request #296 |
Since serializing large objects can sometimes take some time it would be neat if Earl would generate messages lazily, i.e., only if an assertion fails.
For example, instead of:
https://github.com/l2beat/earl/blob/ea923158550558c46336f0a1038ad522ec62cc43/packages/earl/src/validators/basic/toBeTruthy.ts#L38C1-L45C2
let's do something like this:
I do not have benchmarks to back this claim up but I don't see why it wouldn't lead to a substantial performance gain.
The text was updated successfully, but these errors were encountered: