Comments (3)
Hi, thank you, useful analysis!
Sidetracked with compilation times, haha, I know that feeling very well :)
-
I have some work-in-progress changes for the TestSuite macros in #140. Got some results there but nothing significant enough to make that patch worth merging alone, still need to look into that more. OTOH the test code makes up maybe 90% of the codebase, the test files are heavy on their own, often being several thousands lines long with the
CORRADE_COMPARE*
macros used on almost every second line, so those showing up high in the profiler output isn't unexpected (I'd be surprised if those didn't show up high).Unfortunately I don't have a comparison to how gtest or other popular testing frameworks would behave at the same scale -- maybe I'm completely fine compared to those -- nevertheless any improvement is welcome, rebuild time of the 6700-line GltfImporterTest.cpp is almost 5 seconds and is enough to get me impatient :D
-
Question is whether those headers actually are heavy, or if it's just that they're used a lot -- they don't contain that much on their own (look at Pointer.h, there isn't much left to remove, apart from micro-optimizing some type traits), and all headers are parsed in about 50-80 ms which I think is fine. Which is also probably why PCHs didn't help you that much -- there just isn't any widely used header that would be heavy on its own for PCHs to make a difference.
As I'm aware the most significant overhead comes from STL
<sstream>
usage, which is used in almost all tests for historical reasons, and which I didn't get to replacing yet because it involves reinventing/replacing many wheels, including float printing (tracking issue here: mosra/magnum#293).Finally, not sure if you had a debug or release build, but on a release build a lot of debug-only assertions from headers is compiled out, which has a considerable impact. Oh, and the on-by-default
CORRADE_BUILD_DEPRECATED
option also currently adds quite a few compatibility STL includes in many places, includingTester.h
, to aid people with porting from APIs that usedstd::string
to the newStringView
. Disabiling it can make quite a difference -- if you had it enabled before, can you try again with it disabled? -
Thanks! I'll cherry-pick those from your commit. I'm on Linux, so I have to admit I don't have an immediate feedback when
windows.h
accidentally escapes the cage somewhere. -
Yup, I reached a similar conclusion recently. Can't really make C++14 a minimum yet (need GCC 4.8 compatibility for certain users), but maybe I could opt into variable templates if C++14 is available... or use compiler builtins instead. But there are downsides, I don't feel like maintaining my own variant of
<type_traits>
with all its compiler-specific magic :)Possibly related is that I use
std::enable_if
"wrong" in quite a few places, by having it in the function signature and thus participate in overload resolution. Need to clean that up to be on the return type instead.
from corrade.
@mosra: been playing around with some possible improvements here -- https://github.com/vittorioromeo/corrade/tree/wip_type_traits
I do get a minor compilation time speedup on my machine, I wonder if it's measurable on yours (or on CI).
from corrade.
Hey, that's great, thank you! :)
I have to think about the compilation time vs maintenance overhead (e.g., "what all do I need to change if a new compiler would implement a builtin of the same name but with different semantics", or the amount of additional test coverage that would be needed for each of these, or how hard will then be for a third party to contribute anything to this codebase given not even the standard type traits would be used anymore), but quite a lot of these seem quite simple and free of compiler magic.
Something similar is done in bgfx, and with success, so that's probably a path forward for me as well. Once I fix the bigger fish, like <sstream>
๐
from corrade.
Related Issues (20)
- Corrade's test suite fails under AddressSanitizer HOT 9
- Corrade with BUILD_TESTS=ON compilation error: call to non-โconstexprโ function HOT 5
- Error when installing via HunterGate HOT 7
- Prefix cmake options with CORRADE_ HOT 4
- Windows: inconsistent redefinition of _aligned_malloc HOT 3
- Corrade adds /wd*** warning disablements to "clang.exe" on windows. HOT 1
- Building Corrade with -std=c++20 causes errors inside MinGW <numbers> header HOT 3
- Corrade fails to compile with emscripten 3.1.22 HOT 4
- Opt-in to native UTF-8 support for OS interaction on Windows
- std::tuple_size / tuple_element specializations for Corrade containers HOT 1
- error: cannot initialize a variable of type 'const char *const' with an rvalue of type 'int' HOT 3
- Interconnect - Slots are not called according to their record order HOT 1
- V8::Zone Allocator HOT 1
- NEON code does not build on armv7 HOT 2
- what to set CORRADE_INCLUDE_DIR to for in-source-builds HOT 2
- JsonToken::asObject() odd behavior with empty objects HOT 2
- New Release HOT 1
- Broken Interconnect on Clang-CL 16.0.5 HOT 9
- Packaging location of GDB script files HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corrade.