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

Refactor - replace list with deque: TaskSet._task_queue & WindowsKeyPoller.captured_chars #2431

Closed

Conversation

tdadela
Copy link
Contributor

@tdadela tdadela commented Oct 21, 2023

TaskSet._task_queue & WindowsKeyPoller.captured_chars use methods responsible for removing/appending elements at beginning & end.
collections.deque performs those in constant time in contrast with list (linear time for appending/removing at beginning).

@cyberw
Copy link
Collaborator

cyberw commented Oct 21, 2023

Irrelevant for real performance. Not technically worse than the current implementation but not significantly better either.

@cyberw cyberw closed this Oct 21, 2023
@tdadela
Copy link
Contributor Author

tdadela commented May 4, 2024

You've changed your mind about TaskSet._task_queue implementation in #2698 & #2653.
If you want, I can open a new PR with changes in input_events.py.

@cyberw
Copy link
Collaborator

cyberw commented May 4, 2024

I’m sorry, I got confused by your changes in input_events. They are not really relevant for performance, but your changes in TaskSet really were, and I should have accepted this PR. If you want to make a new PR for input events I will accept it.

@tdadela
Copy link
Contributor Author

tdadela commented May 5, 2024

No problem. Thanks for the response.

@tdadela tdadela deleted the refactor_replace_list_with_deque branch May 5, 2024 10:48
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