Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImproved headless Servo performance #18777
Conversation
Now the main thread doesn't waste 100% CPU
highfive
commented
Oct 7, 2017
|
Heads up! This PR modifies the following files:
|
|
This is good enough for tests. If headless mode is only used for tests, I think this approach is ok. But if Headless mode is used for anything else, we need a better approach. I think the proper way of doing this is:
Then the loop would run only if needed. |
|
@bors-servo try |
Improved headless Servo performance Now the main thread doesn't waste 100% CPU, polling for events. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18770 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because: I verified Servo works correctly in headless mode, and the linked issue is gone. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18777) <!-- Reviewable:end -->
|
@jdm do you think we should just add this sleep call, or do as I describe in my previous comment (less trivial)? I'm happy with both approaches. |
|
Why don't we make this change right now and file an issue for doing it the proper way? |
|
Ok. @mateon1: code looks good. Maybe move the sleep in |
|
Thank you. I filed #18799 Can someone r+ this? |
|
@bors-servo r+ |
|
|
Improved headless Servo performance Now the main thread doesn't waste 100% CPU, polling for events. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18770 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because: I verified Servo works correctly in headless mode, and the linked issue is gone. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18777) <!-- Reviewable:end -->
|
|
mateon1 commentedOct 7, 2017
•
edited by SimonSapin
Now the main thread doesn't waste 100% CPU, polling for events.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is