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

Scons: provide the number of logical processors as the number of maximum concurrent jobs to speed up builds #13226

Merged
merged 5 commits into from
Jan 13, 2022

Conversation

LeonarddeR
Copy link
Collaborator

@LeonarddeR LeonarddeR commented Jan 10, 2022

Link to issue number:

None

Summary of the issue:

Building NVDA can take some time. SCons has the ability to provide the number of concurrent jobs during build.

Description of how this pull request fixes the issue:

Specify the maximum number of concurrent jobs when building NVDA.

Testing strategy:

Tested locally on an Intel Core i7-9850H using PowerShell's measure-command { .\scons.bat source }, ensuring the venv was created prerun.

  • Without the change, 170 seconds
  • With the change, 59 seconds

Known issues with pull request:

Output sometimes get a bit scrambled, i.e. the output of the cl command comes before SCons output the name of the file being build.

Change log entries:

For Developers

  • Set up SCons to build with multiple concurrent jobs, equal to the number of logical processors in the system (i.e. 8 on a quat core Intel CPU with hyper threading). This can dramatically decrease build times on multi core systems.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@LeonarddeR LeonarddeR requested a review from a team as a code owner January 10, 2022 18:50
@LeonarddeR LeonarddeR requested a review from seanbudd January 10, 2022 18:50
@LeonarddeR
Copy link
Collaborator Author

Note, this doesn't seem to have any noticeable benefit on appveyor.

@josephsl
Copy link
Collaborator

josephsl commented Jan 11, 2022 via email

@Brian1Gaff
Copy link

Brian1Gaff commented Jan 11, 2022 via email

@seanbudd
Copy link
Member

Is there a way to disable this for appveyor? Scrambling the output of try/PR builds and official builds without a time improvement seems like a loss.

@AppVeyorBot
Copy link

Copy link
Member

@seanbudd seanbudd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @LeonarddeR

@michaelDCurran
Copy link
Member

I'm really struggling with the merging of this pr. It is very hard to follow build output now, especially when trying to see errors from cl. This gets worse with the introduction of calling msbuild for the remote ops library.
Note that I have 12 logica processors, so there is a great deal going on at the same time.
I think parallel builds are a great advantage, but I do feel they should be optional. I.e. by specifying -j 12 (or how ever many you want) when running scons.
Pr #13367 has become necessary since this merge. And although we should probably take that one as parallel builds should work if people want them, I don't believe enforcing them by default, especially within a developer context is the right thing here.

I feel that this pr should be reverted.

@seanbudd
Copy link
Member

@LeonarddeR @michaelDCurran can this be overridden with -j1 eg scons source -j1? This could either be a workaround, at least until the PR is reverted.

Would you like me to revert this? GitHub won't open a revert PR automatically

@lukaszgo1
Copy link
Contributor

Have you reported the scrambled output thing to SCons?? While this would probably be pretty difficult to fix not reporting the problem makes it guaranteed not to be fixed.

seanbudd pushed a commit that referenced this pull request Mar 3, 2022
…r of maximum concurrent jobs to speed up builds by default (#13371)

Reverts #13226

Summary of the issue:
While building NVDA with multiple jobs leads to faster build times, it also leads to scrambled output which can be quite annoying when debugging.

Description of how this pull request fixes the issue:
Disable multiple jobs by default but warn users to run with -jX to get a faster build if applicable.
michaelDCurran pushed a commit that referenced this pull request Mar 10, 2022
…rallel builds (#13367)

Fixes #13290
Related to this thread on nvda-devel by @MarcoZehe

Summary of the issue:
PR #13226 started building nVDA in parallel. While this offers significant speed improvements the way in which we were generating COMInterfaces was not thread safe. The issue was caused by the fileinput module which redirects stdout to a given file and this cannot be done in multiple threads at the same time. Also, as discovered by @MarcoZehe in the thread linked above when stdout is redirected to a file some other build step which is executing in a separate thread can write to it and the text which should be shown on screen ends up in the COMInterface file.

Description of how this pull request fixes the issue:
Were not using fileinput anymore - the IDE friendly content is generated in memory and then written to the file afterwards.
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.

8 participants