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

Further improvements on compile time - disable inlining of functions used in asserts #70

Closed
onqtam opened this issue May 12, 2017 · 4 comments

Comments

@onqtam
Copy link
Member

onqtam commented May 12, 2017

No description provided.

onqtam added a commit that referenced this issue May 12, 2017
…or the ctor/dtor of the Result class - but 100% sure about the fast_binary_assert() template function) - this should have a very tiny penalty on runtime which is superb anyway but might impact compile times in a very positive way - not benchmarked yet - relates #70
@onqtam
Copy link
Member Author

onqtam commented May 12, 2017

binary and fast asserts are almost 3-4 times faster to compile in release mode with MSVC! unfortunately not much effect for other compilers/configs

@onqtam onqtam closed this as completed May 12, 2017
onqtam added a commit that referenced this issue May 15, 2017
…or the ctor/dtor of the Result class - but 100% sure about the fast_binary_assert() template function) - this should have a very tiny penalty on runtime which is superb anyway but might impact compile times in a very positive way - not benchmarked yet - relates #70
@onqtam onqtam mentioned this issue Sep 7, 2020
@Trass3r
Copy link

Trass3r commented Sep 7, 2020

binary and fast asserts are almost 3-4 times faster to compile in release mode with MSVC! unfortunately not much effect for other compilers/configs

You should test with -Zc:inline to make msvc behave properly like other compilers.

@onqtam
Copy link
Member Author

onqtam commented Sep 7, 2020

Well the thing about -Zc:inline is that it's a compiler option and doctest doesn't try to enforce anything build-system-related. I could make it an INTERFACE property of the doctest CMake target, but not sure if that's nice, + the goal is to be as optimal as possible for all use cases (even when users get the header with wget/curl - without the CMake target).

@Trass3r
Copy link

Trass3r commented Sep 7, 2020

I know but it's not a good idea to optimize for a single compiler's broken default mode that only exists for insane backwards compatibility with non-sense (and since C++11 non-conforming) code.
Also it's the default for the average user anyway: https://devblogs.microsoft.com/cppblog/feedback-making-zcinline-default-for-debugrelease-configs-in-14/

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

No branches or pull requests

2 participants