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

Replace Thread.Sleep with task.Delay #7427

Open
alekhyareddy28 opened this issue Oct 20, 2020 · 2 comments
Open

Replace Thread.Sleep with task.Delay #7427

alekhyareddy28 opened this issue Oct 20, 2020 · 2 comments
Labels
Area-Quality Stability, Performance, Etc. Area-Tests issues that relate to tests Cost-Small Small work item - 0-8 hours of work Help Wanted We encourage anyone to jump in on these and submit a PR. Product-Color Picker All things around the Color Picker utility Product-PowerToys Run Improved app launch PT Run (Win+R) Window

Comments

@alekhyareddy28
Copy link
Contributor

Performance Improvement of PT Run

Similar to PR #7401, replacing Thread.Sleep with Task.Delay throughout the codebase would improve the performance of PT Run as Thread.Sleep blocks the thread that it is called on whereas Task.Delay uses a timer instead and schedules a thread to resume work after the interval has passed. This does not block the thread.

@ghost ghost added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Oct 20, 2020
@crutkas
Copy link
Member

crutkas commented Oct 20, 2020

From the current snapshot in master, here is the offenders

image

@crutkas crutkas added Area-Quality Stability, Performance, Etc. Cost-Small Small work item - 0-8 hours of work Help Wanted We encourage anyone to jump in on these and submit a PR. Area-Tests issues that relate to tests Product-Color Picker All things around the Color Picker utility Product-PowerToys Run Improved app launch PT Run (Win+R) Window and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels Oct 20, 2020
@crutkas crutkas added this to the Priority work bucket milestone Feb 9, 2022
@Jay-o-Way
Copy link
Collaborator

image
The use of Thread.Sleep has increased enormously. Note that MouseWithoutBorders uses values like 1000, 5000 and even 30'000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Quality Stability, Performance, Etc. Area-Tests issues that relate to tests Cost-Small Small work item - 0-8 hours of work Help Wanted We encourage anyone to jump in on these and submit a PR. Product-Color Picker All things around the Color Picker utility Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
Status: No status
Status: ⚠️Needs Walkthrough
Development

No branches or pull requests

5 participants