Skip to content

Remove typing.cast() in hot code path#1572

Merged
einarf merged 1 commit intopythonarcade:developmentfrom
cspotcode:remove-cast-from-hit-code-path
Feb 22, 2023
Merged

Remove typing.cast() in hot code path#1572
einarf merged 1 commit intopythonarcade:developmentfrom
cspotcode:remove-cast-from-hit-code-path

Conversation

@cspotcode
Copy link
Collaborator

@cspotcode cspotcode commented Feb 22, 2023

Since this is such a hot code path, avoiding the cost of a function call gives a noticeable improvement in performance.

@einarf
Copy link
Member

einarf commented Feb 22, 2023

The cast is only cosmetic for the type checked, so we might as well do this.

@einarf einarf merged commit 1a3e993 into pythonarcade:development Feb 22, 2023
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.

2 participants