Remove a cast that occurs in the hot path in AstArcAnalyzer by reaperhulk · Pull Request #2213 · coveragepy/coveragepy · GitHub
Skip to content

Remove a cast that occurs in the hot path in AstArcAnalyzer#2213

Open
reaperhulk wants to merge 2 commits into
coveragepy:mainfrom
reaperhulk:remove-cast
Open

Remove a cast that occurs in the hot path in AstArcAnalyzer#2213
reaperhulk wants to merge 2 commits into
coveragepy:mainfrom
reaperhulk:remove-cast

Conversation

@reaperhulk

Copy link
Copy Markdown

I'm not sure why this was a cast, but it doesn't appear to be necessary any more. Since cast() evaluates its first argument, this constructs a new collections.abc.Callable on every call. This change speeds up arc analysis somewhere around 10% for pyca/cryptography (which is, admittedly, only about 100-200ms).

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.

1 participant