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

does not allow performance optimization in logic #1299

Open
Kevin222004 opened this issue Jan 30, 2024 · 1 comment
Open

does not allow performance optimization in logic #1299

Kevin222004 opened this issue Jan 30, 2024 · 1 comment

Comments

@Kevin222004
Copy link

Kevin222004 commented Jan 30, 2024

This issue we have faced in loops where some conditions are for breaking the loop but Pitest will force to remove that logic
for example

        while (result
                && !isUsedVariableDeclarationFound
                && currentSiblingAst != null) {

mutated as

        while (!isUsedVariableDeclarationFound
                && currentSiblingAst != null) {

by the removal of the result, the output will not affect.
but the whole loop can run for more time than it was running with the result. This type of change is not good as it might lead to a problem. checkstyle/checkstyle#13120

similar issue faced at checkstyle/checkstyle#13557,
checkstyle/checkstyle#13149

@romani
Copy link
Contributor

romani commented Jan 31, 2024

This type of change is not good as it might lead to a problem.

We did update to do extra loop only because this is nano optimization will not do any significant difference, but dealing with alive mutation cost more in long run.

But we give this feedback to share that some extra loop iteration might be costly and maybe there is a way to update mutation to not raise such cases as survivals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants