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

[Build] - Reduce libsairedis build time by 16m #1413

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mikemallin
Copy link

Add -fno-var-tracking-assignments to pysairedis_wrap.cpp when built with GCC

This improves compilation time by a total of 16m by disabling the GCC feature "Variable Tracking Assingments."

The trade-off for disabling this feature is reduced debuggability if anyone needs to go through the object file pysairedis_wrap.o with a debugger. Please see the background below for details.

This was identified via the following issue in the SWIG project:

This is a performance issue in GCC specifically, not CLANG.

Results:

On a server with the following specifications, the build time for libsairedis went from 20m23s down to 3m50s.

CPU: Intel(R) Xeon(R) Gold 6430
RAM: 1Tb DDR5
OS: Ubuntu 22.04
g++: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

On an Apple MacBook Pro (with a Debian build VM), the build time for libsairedis also dropped significantly from 17m43s down to 3m46s

CPU: Apple M3 Pro
RAM: 18Gb
OS: Debian 12 Bookworm
g++: g++ (Debian 12.2.0-14) 12.2.0

Background:

@mikemallin mikemallin force-pushed the dev/swig-gcc-fno-var-tracking-assignments branch from e440f74 to ebc07f7 Compare August 16, 2024 13:58
kcudnik
kcudnik previously approved these changes Aug 16, 2024
@mikemallin
Copy link
Author

@kcudnik I've fixed the build issue, would it be possible to approve again? Thanks!

@mikemallin mikemallin force-pushed the dev/swig-gcc-fno-var-tracking-assignments branch from 74f6f84 to 61f1723 Compare September 12, 2024 17:21
…ith GCC

This improves compilation time by a total of 16m by disabling the GCC
feature "Variable Tracking Assingments."

The trade-off for disabling this feature is reduced debuggability if anyone
needs to go through the object file pysairedis_wrap.o with a debugger. Please
see the background below for details.

This was identified via the following issue in the SWIG project:
- swig/swig#2384 (comment)

This is a performance issue in GCC specifically, not CLANG.

Results:
On a server with the following specifications, the build time for
libsairedis went from 20m23s down to 3m50s.

    CPU: Intel(R) Xeon(R) Gold 6430
    RAM: 1Tb DDR5
    OS: Ubuntu 22.04
    g++: g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

On an Apple MacBook Pro (with a Debian build VM), the build time
for libsairedis also dropped significantly from 17m43s down to
3m46s

    CPU: Apple M3 Pro
    RAM: 18Gb
    OS: Debian 12 Bookworm
    g++: g++ (Debian 12.2.0-14) 12.2.0

Background:
- https://gcc.gnu.org/wiki/Var_Tracking_Assignments
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/6/html/developer_guide/ch-debug-vta#ch-debug-vta

Signed-off-by: Mike RE Mallin <[email protected]>
@mikemallin mikemallin force-pushed the dev/swig-gcc-fno-var-tracking-assignments branch from 61f1723 to 0440fc8 Compare September 17, 2024 16:43
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