Sitelet https://web.archive.org/web/20260501055031/https://github.com/github/codeql/pull/4203
Skip to content

C++: Fix performance in Iterator.qll#4203

Closed
rdmarsh2 wants to merge 1 commit intogithub:mainfrom
rdmarsh2:rdmarsh2/cpp/iterator-explicit-conversion-perf
Closed

C++: Fix performance in Iterator.qll#4203
rdmarsh2 wants to merge 1 commit intogithub:mainfrom
rdmarsh2:rdmarsh2/cpp/iterator-explicit-conversion-perf

Conversation

@rdmarsh2
Copy link
Copy Markdown
Contributor

@rdmarsh2 rdmarsh2 commented Sep 3, 2020

No description provided.

@rdmarsh2 rdmarsh2 requested a review from a team as a code owner September 3, 2020 20:38
@rdmarsh2 rdmarsh2 force-pushed the rdmarsh2/cpp/iterator-explicit-conversion-perf branch from 8b2771c to 3752c46 Compare September 3, 2020 22:33
Copy link
Copy Markdown
Contributor

@jbj jbj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you prefer that we merge this PR more or less as is, please post the before-and-after performance numbers.

exists(Expr arg | arg = op.getACallToThisFunction().getArgument(index) |
result = arg.getConversion*() and
(result = arg or not result.(Cast).isImplicit()) and
not exists(Cast other | other = result.getConversion+() and not other.isImplicit())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be more readable to me as a forall.

Comment thread cpp/ql/src/semmle/code/cpp/models/implementations/Iterator.qll
@jbj
Copy link
Copy Markdown
Contributor

jbj commented Sep 11, 2020

Now that #4213 is merged, it's my understanding that this PR no longer provides large enough performance savings to make up for the added complexity. I'll close this, but please reopen if you think this change is still worth making.

@jbj jbj closed this Sep 11, 2020
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

Successfully merging this pull request may close these issues.

3 participants