-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Deferify Mutant #1420
Deferify Mutant #1420
Conversation
8b7d7e9
to
2b4d93a
Compare
Could be easier to follow if we were to get rid of Mutant? (#1209) I can take some time to rebase the PR this weekend if necessary, but I would be curious to see if that can help out with those performance gains as well |
There's no contradiction here. If we'd get rid of Mutant, we'll still have to manage diffing and pretty-printing (#1209 does that in the same order, e.g. long before use). And therefore if we'd do that in a deferred way, there will be the same readability issue. If we'd consider that a Mutant, or what is in place of it, could do none of the diffing and printing, but instead pass around ASTs, we'll no longer have this problem, but that's a huge responsibility skew with quite a blast radius. I'm not so certain it's going to be worth it, yet neither I can say it's a bad idea. It is just somewhat more difficult that the current approach. In other words, the reason we're paying with sequentiality here is because making program less sequential while achieving the same goal will require less amount of change (smallest blast radius). |
Yes I recall that, but actually could easily be done lazily as you mentioned although this comes at the cost of holding the whole AST in-memory for longer I did not mean that there is contradiction, just that there a big overlap and that maybe your PR would look a lot simpler after #1209. But if you don't think so I guess I'll have to take on myself to do a more complex rebase :P That said I would like us to move forward a bit on #1209 because I don't want to have to rebase it if we don't want that change at all... |
Well, I feel your pain. Sorry about that! Do you think you can reduce #1209 to more manageable partial PRs? You have an itch to do the rename/removal, and can't ignore but respect that, yet it's kind of difficult to get #1209 in your head. If it wasn't we'll have had it done already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think #1209 should block anything here. It's
- already stale for a half of the year
- arguable (I still don't agree with the renamings), we don't have an agreement there
Thank you @maks-rafalko |
Hm apparently I forgot to push my comment.
Outch that hurts :( Anyway I'll try to see if there is anything that can be extracted. I don't want to spend hours refactoring/rebasing a PR that is not going to be merged |
didn't mean to hurt you, sorry! But those 2 points are what I see. |
This PR is a follow-up to #1422:
Running this on Psalm with a config below, without any file logging:
infection.json and command line arguments
Command line:
There's almost no difference if logging is enabled, which makes sense: we'll have to unlazify the diffs to log them.
With
--no-progress --show-mutations
and no additional logging I get:This is 30% faster!
It is true this lazy evaluation isn't coming without a price, but I tend to think it's worth it. More about it below.
Discussion
It is clear to see the speed boost we're having, but there are drawbacks:
--only-covered
it makes no sense to hold on to uncovered mutations. We might count them, but that should be it.