Analysis of compilation times, choice of template instantiation #2266
ManifoldFR
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
I am currently building some C++ code against Pinocchio. I noticed some symbols (related to calling
pinocchio::urdf::buildModel<double>()
) were being instantiated, which is fair enough because not all ofpinocchio_parsers
is explicitly template-instantiated.After discussing with @jorisv, I went over to code-analysis-tools and followed the steps to trace the compilation time of my cpp file.
I noticed that instantiating
pinocchio::urdf::buildModel<double>()
took about 614ms to an overall 7100ms compilation time for my file.For comparison, instantiating the constructor
ModelTpl<double>::ModelTpl
(which we think is the copy constructor) took about 900ms but if I recall correctly, this is a deliberate choice to favor runtime performance by letting the compiler inline.The file pretty much only included
pinocchio/multibody/model.hpp
andpinocchio/parsers/urdf.hpp
and loaded an URDF file into apinocchio::Model
.Suggestion
The idea here would be to, at some point, profile how long it takes to instantiate non-critical functions or classes (stuff that doesn't need to get inlined) and whether to add template instantiation to these. We could do that by looking over at the examples
Beta Was this translation helpful? Give feedback.
All reactions