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
Use "split" version of 'miniaudio' and Pimpl 'AudioDevice' #2982
Use "split" version of 'miniaudio' and Pimpl 'AudioDevice' #2982
Conversation
@ChrisThrasher: what would be the proper way of compiling and linking against |
I measured compiling
|
What you did Something to keep in mind is that the way we run clang-tidy relies on analyzing all files that appear in compile_commands.json. If we add a 3rd party source file to the build (as in we actually tell CMake about it) then it will appear in that file and thus get analyzed. No 3rd party source file is going to pass all of our clang-tidy checks so that will cause CI to break. What you proposed seems to avoid that issue since the build system has no idea we added a new source file. |
I see a slight improvement with this PR, but YMMV. I suppose that people with slower SSDs or worse specs will benefit more from this PR. I also think you should benchmark tests and examples as well, to measure the impact on the TUs that might include headers that include
|
miniaudio.h is not included in any public SFML headers which is why I ignored tests and examples. |
I apologize, you are correct. I didn't realize |
How does this PR change anything about this situation? Since you include a C file, isn't the outcome exactly the same? Also, I'm against doing weird things like including source files to shave off 0.1s build time on a specific system. The analyzers are also not happy for good reasons, and I wouldn't want to silence them just for this. |
Besides the points already mentioned above, bear in mind that in the case of miniaudio, the maintainer explicitly mentions in the split files readme that they are derived from the single header file and not the other way around. As such, the miniaudio single header is officially the preferred way of using miniaudio if a project has the choice of choosing between both methods. The reason why this change basically doesn't change build times is because including the single header without defining Whoever looks for a performance benefit to this change will not find one, because it practically doesn't exist unless you are using an operating system and compiler from the 90s. |
…orioromeo/SFML into feature/use_miniaudio_split
New results measured with ClangBuildAnalyzer:
@eXpl0it3r: the
@eXpl0it3r: I am happy to avoid the
@binary1248: I had seen that, and verified that the split version was up-to-date. Considering our
@binary1248: I did see a difference in my benchmarks using I've also added extra improvements to make this PR more useful. |
Pull Request Test Coverage Report for Build 8983900711Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
I guess, I don't fully understand how the files are processed. I thought the preprocessor would just blindly copy paste code, not really caring if your file extension is .h or .c and we only changed one include. 🤷
I believe the proper way to solve this would be to make mini audio its own target/lib and not just include it into SFML's source. No idea what impact that has on compilation.
Honestly, this still doesn't convince me at all to add all the provided changes. I know compile time is something important to you and you enjoy fiddling with it, but I feel in this case we're really micro optimizing around a non-existent problem, with focus on one specific build platform and configuration. At the same time we probably have a lot more open issues that we could spend our time on more productively.
What do we gain with the new pimpl implementation? |
Closing with same rationale as: |
The header-only version of miniaudio is almost 4MB. This means that every translation unit that includes
miniaudio.h
basically copy-pastes 4MB inside itself, even though all translation units but one need the implementation.Split version is available directly from the miniaudio repo:
https://github.com/mackron/miniaudio/tree/master/extras/miniaudio_split