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

2x Compile Speed up #157

Merged
merged 6 commits into from
Apr 19, 2024
Merged

2x Compile Speed up #157

merged 6 commits into from
Apr 19, 2024

Conversation

Tyler-Lentz
Copy link
Contributor

@Tyler-Lentz Tyler-Lentz commented Apr 18, 2024

SOURCES ARE SAYING THAT THIS IS THE GREATEST OBCPP PR THEY HAVE EVER SEEN!

Summary

Before (compiling obcpp from scratch with -j4)

image

After (still with -j4)

image

Explanation

I did two things:

  1. Use a CMake feature called Unity Builds which combines groups of files into one compilation unit. You'll notice that compiling the OBC takes significantly less steps as reported by ninja (from scratch, in the before image you'll see 103/103 vs 65/65). This is where the 2x speedup came from.
  2. Use something called Precompiled headers, which precompiles commonly used headers. Unfortunately, this didn't seem to speed up compilation at all, although nor did it slow it down. I'm leaving it in because it still works with it, and theoretically someone could figure out what I did wrong and maybe get some speedup from it.

Extra Notes:

Don't delete dummy.c, Dummy.

@Tyler-Lentz Tyler-Lentz changed the title 2x + Compile Speed up 2x Compile Speed up Apr 18, 2024
@Tyler-Lentz Tyler-Lentz marked this pull request as ready for review April 18, 2024 22:56
@jerukan
Copy link
Member

jerukan commented Apr 19, 2024

OH MY GOD ITS THE GREATEST PR EVER IM GONNA BECOME THE FLASH WITH THIS SPEED

Copy link
Contributor

@AskewParity AskewParity left a comment

Choose a reason for hiding this comment

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

Works in MacOS

Copy link
Member

@atar13 atar13 left a comment

Choose a reason for hiding this comment

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

Works on Jetson

@Tyler-Lentz Tyler-Lentz merged commit 274182e into main Apr 19, 2024
2 checks passed
@Tyler-Lentz Tyler-Lentz deleted the chore/speed-up-compile branch April 19, 2024 01:27
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.

4 participants