Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

split private.hpp for faster compilation#20277

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
SyPeter wants to merge1 commit intoopencv:masterfromjulianreisch:splitprivateiw

Conversation

@SyPeter
Copy link

With the help of a code analysis tool we built, we noticed that private.hpp (indirectly) includes iw_image.hpp altough most cpps that include private.hpp do not use iw_image. This causes a huge amount of unnecessarily included lines of code for these cpps. Therefore, we split private.hpp into two files, and include the new file that includes iw_image only where it is needed. This results in a reduction of approx. 2 millions of lines of code (after preprocessor) and hence a reduced compilation time.

@alalek
Copy link
Member

Please provide performance numbers (with information about used configuration).

AFAIK, code parsing usually takes less than 10% in compiler pipeline.

@julianreisch
Copy link

We measured 25 sec less build time (user time) on average (3 runs each): From 4036 sec down to 4011 sec. Our machine is an intel i7 8700k, we use ubuntu 20.04 and invoked cmake with "-DCMAKE_BUILD_TYPE=RelWithDebInfo". Is this the information you were looking for?

@alalek
Copy link
Member

Thank you for information!

Unfortunately such extra changes for possible benefits less that 1% (25 sec from 4000) doesn't look good.
Consider usingccache if you need to build OpenCV frequently (no problem withccache on Linux platform).

Anyway 4000sec per build is really slow (check free RAM (too many compilation processes may eat all memory), and storage speed (avoid using of network storage)).
I have about 1450sec forRelWithDebInfo build on i5-6600 (with tests, without examples). Rebuild with ccache is about 30sec (SSD).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@SyPeter@alalek@julianreisch@asmorkalov

[8]ページ先頭

©2009-2025 Movatter.jp