Skip to content

Instantly share code, notes, and snippets.

@tritao
Created January 19, 2025 11:04
Show Gist options
  • Save tritao/9411d635dec698433e2e355dc69b24fb to your computer and use it in GitHub Desktop.
Save tritao/9411d635dec698433e2e355dc69b24fb to your computer and use it in GitHub Desktop.
FreeCAD compile time analysis
Analyzing build trace from 'FreeCAD/bld-time/trace.out'...
**** Time summary:
Compilation (2324 times):
Parsing (frontend): 28802.2 s
Codegen & opts (backend): 1670.7 s
**** Files that took longest to parse (compiler frontend):
109871 ms: traces/qrc_resource.cpp.json
109871 ms: traces/src/Gui/CMakeFiles/FreeCADGui.dir/qrc_resource.cpp.json
59126 ms: traces/SketchObject.cpp.json
59126 ms: traces/src/Mod/Sketcher/App/CMakeFiles/Sketcher.dir/SketchObject.cpp.json
44770 ms: traces/CommandCreateGeo.cpp.json
44770 ms: traces/src/Mod/Sketcher/Gui/CMakeFiles/SketcherGui.dir/CommandCreateGeo.cpp.json
43436 ms: traces/WireJoiner.cpp.json
43436 ms: traces/src/Mod/Part/App/CMakeFiles/Part.dir/WireJoiner.cpp.json
41588 ms: traces/src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.json
41488 ms: traces/CommandSketcherTools.cpp.json
**** Files that took longest to codegen (compiler backend):
14097 ms: traces/SketchObject.cpp.json
14097 ms: traces/src/Mod/Sketcher/App/CMakeFiles/Sketcher.dir/SketchObject.cpp.json
13562 ms: traces/src/App/CMakeFiles/FreeCADApp.dir/Document.cpp.json
11890 ms: traces/Tree.cpp.json
11890 ms: traces/src/Gui/CMakeFiles/FreeCADGui.dir/Tree.cpp.json
10490 ms: traces/GCS.cpp.json
10490 ms: traces/src/Mod/Sketcher/App/CMakeFiles/Sketcher.dir/planegcs/GCS.cpp.json
9030 ms: traces/CommandCreateGeo.cpp.json
9030 ms: traces/src/Mod/Sketcher/Gui/CMakeFiles/SketcherGui.dir/CommandCreateGeo.cpp.json
8988 ms: traces/Document.cpp.json
**** Templates that took longest to instantiate:
325486 ms: fmt::vsprintf<fmt::basic_string_view<char>, char> (500 times, avg 650 ms)
319204 ms: fmt::detail::vprintf<char, fmt::basic_printf_context<fmt::appender, ... (500 times, avg 638 ms)
239453 ms: std::vector<boost::variant<boost::weak_ptr<boost::signals2::detail::... (1497 times, avg 159 ms)
199475 ms: std::vector<boost::variant<boost::shared_ptr<void>, boost::signals2:... (1497 times, avg 133 ms)
196327 ms: std::vector<boost::variant<boost::weak_ptr<boost::signals2::detail::... (1497 times, avg 131 ms)
177773 ms: fmt::sprintf<const char *, char> (325 times, avg 546 ms)
176706 ms: std::vector<boost::variant<boost::weak_ptr<boost::signals2::detail::... (1497 times, avg 118 ms)
159971 ms: std::vector<boost::variant<boost::shared_ptr<void>, boost::signals2:... (1497 times, avg 106 ms)
143405 ms: std::vector<boost::variant<boost::shared_ptr<void>, boost::signals2:... (1497 times, avg 95 ms)
122874 ms: std::is_trivially_move_assignable<boost::variant<boost::weak_ptr<boo... (1497 times, avg 82 ms)
107580 ms: boost::enable_if<boost::mpl::and_<boost::is_rvalue_reference<boost::... (1497 times, avg 71 ms)
107379 ms: boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::we... (1497 times, avg 71 ms)
107152 ms: boost::mpl::aux::and_impl<true, boost::mpl::not_<boost::is_const<boo... (1497 times, avg 71 ms)
106932 ms: boost::mpl::aux::and_impl<true, boost::detail::variant::is_variant_c... (1497 times, avg 71 ms)
106772 ms: boost::mpl::aux::nested_type_wknd<boost::detail::variant::is_variant... (1497 times, avg 71 ms)
106644 ms: boost::detail::variant::is_variant_constructible_from<boost::variant... (1497 times, avg 71 ms)
106554 ms: boost::detail::variant::is_variant_constructible_from<boost::variant... (1497 times, avg 71 ms)
106358 ms: boost::mpl::find_if<boost::mpl::list3<boost::weak_ptr<boost::signals... (1497 times, avg 71 ms)
106197 ms: boost::mpl::iter_fold_if<boost::mpl::list3<boost::weak_ptr<boost::si... (1497 times, avg 70 ms)
106011 ms: boost::variant<boost::shared_ptr<void>, boost::signals2::detail::for... (1497 times, avg 70 ms)
106000 ms: boost::mpl::iter_fold_if<boost::mpl::list3<boost::weak_ptr<boost::si... (1497 times, avg 70 ms)
105861 ms: boost::mpl::aux::iter_fold_if_impl<boost::mpl::l_iter<boost::mpl::li... (1497 times, avg 70 ms)
96322 ms: Base::ConsoleSingleton::Log<> (186 times, avg 517 ms)
91436 ms: std::is_trivially_move_assignable<boost::variant<boost::shared_ptr<v... (1497 times, avg 61 ms)
84719 ms: boost::apply_visitor<boost::signals2::detail::lock_weak_ptr_visitor,... (1497 times, avg 56 ms)
84083 ms: boost::variant<boost::weak_ptr<boost::signals2::detail::trackable_po... (1497 times, avg 56 ms)
82982 ms: boost::variant<boost::weak_ptr<boost::signals2::detail::trackable_po... (1497 times, avg 55 ms)
82738 ms: boost::multi_index::multi_index_container<App::DynamicProperty::Prop... (1090 times, avg 75 ms)
82174 ms: boost::variant<boost::weak_ptr<boost::signals2::detail::trackable_po... (1497 times, avg 54 ms)
81192 ms: boost::detail::variant::visitation_impl<mpl_::int_<0>, boost::detail... (1497 times, avg 54 ms)
**** Template sets that took longest to instantiate:
1442821 ms: boost::signals2::signal<$> (28354 times, avg 50 ms)
1379206 ms: boost::signals2::detail::signal_impl<$> (28354 times, avg 48 ms)
1312323 ms: std::map<$> (54357 times, avg 24 ms)
1243035 ms: boost::signals2::detail::grouped_list<$> (28354 times, avg 43 ms)
1211988 ms: std::allocator_traits<$> (361305 times, avg 3 ms)
987216 ms: std::__tree<$> (63823 times, avg 15 ms)
671595 ms: std::vector<$>::push_back (9450 times, avg 71 ms)
586317 ms: std::list<$> (32125 times, avg 18 ms)
567660 ms: std::vector<$>::__push_back_slow_path<$> (9422 times, avg 60 ms)
546615 ms: std::vector<$>::__swap_out_circular_buffer (11008 times, avg 49 ms)
544153 ms: boost::mpl::apply2<$> (106874 times, avg 5 ms)
498037 ms: boost::mpl::apply_wrap2<$> (96546 times, avg 5 ms)
474923 ms: boost::mpl::iter_fold_if<$> (33056 times, avg 14 ms)
474908 ms: std::__list_imp<$> (32125 times, avg 14 ms)
464673 ms: boost::mpl::iter_fold_if<$>::result_ (33052 times, avg 14 ms)
461713 ms: boost::mpl::aux::iter_fold_if_impl<$> (33052 times, avg 13 ms)
460199 ms: boost::mpl::and_<$> (54648 times, avg 8 ms)
456656 ms: boost::mpl::aux::nested_type_wknd<$> (57357 times, avg 7 ms)
453736 ms: std::__compressed_pair<$> (276055 times, avg 1 ms)
440293 ms: boost::mpl::aux::and_impl<$> (45928 times, avg 9 ms)
434067 ms: boost::mpl::find_if<$> (27054 times, avg 16 ms)
426603 ms: boost::mpl::aux::iter_fold_if_forward_step<$> (62088 times, avg 6 ms)
406029 ms: std::vector<$> (44798 times, avg 9 ms)
402794 ms: boost::enable_if<$> (37641 times, avg 10 ms)
391988 ms: std::__dispatch_copy_or_move<$> (22724 times, avg 17 ms)
388690 ms: std::__copy<$> (17166 times, avg 22 ms)
383243 ms: boost::mpl::aux::iter_fold_if_pred<$>::apply<$> (59826 times, avg 6 ms)
371469 ms: std::__unwrap_and_dispatch<$> (22724 times, avg 16 ms)
367133 ms: boost::detail::variant::is_variant_constructible_from<$> (21014 times, avg 17 ms)
345979 ms: std::copy<$> (14430 times, avg 23 ms)
**** Functions that took longest to compile:
872 ms: PartGui::Ui_DlgPrimitives::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Mod/Part/Gui/DlgPrimitives.cpp)
617 ms: PartDesignGui::Ui_DlgPrimitives::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp)
494 ms: Gui::SoFCCSysDragger::SoFCCSysDragger() (/home/joao/dev/FreeCAD/src/Gui/SoFCCSysDragger.cpp)
401 ms: Gui::TreeWidget::dropInObject(QDropEvent*, Gui::TreeWidget::TargetIt... (/home/joao/dev/FreeCAD/src/Gui/Tree.cpp)
377 ms: SketcherGui::EditModeConstraintCoinManager::processConstraints(Sketc... (/home/joao/dev/FreeCAD/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp)
315 ms: MeshGui::Ui_DlgRegularSolid::setupUi(QDialog*) (/home/joao/dev/FreeCAD/src/Mod/Mesh/Gui/DlgRegularSolidImp.cpp)
302 ms: Attacher::AttachEngine3D::_calculateAttachedPlacement(std::__1::vect... (/home/joao/dev/FreeCAD/src/Mod/Part/App/Attacher.cpp)
259 ms: Gui::ViewProviderFeaturePythonImp::init(_object*) (/home/joao/dev/FreeCAD/src/Gui/ViewProviderFeaturePython.cpp)
254 ms: PartDesignGui::TaskBoxPrimitives::TaskBoxPrimitives(PartDesignGui::V... (/home/joao/dev/FreeCAD/src/Mod/PartDesign/Gui/TaskPrimitiveParameters.cpp)
249 ms: Sketcher::SketchObject::rebuildExternalGeometry(std::__1::optional<S... (/home/joao/dev/FreeCAD/src/Mod/Sketcher/App/SketchObject.cpp)
247 ms: PartDesignGui::TaskHoleParameters::TaskHoleParameters(PartDesignGui:... (/home/joao/dev/FreeCAD/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp)
231 ms: Ui_TaskSketcherSolverAdvanced::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherSolverAdvanced.cpp)
228 ms: PartDesign::Hole::execute() (/home/joao/dev/FreeCAD/src/Mod/PartDesign/App/FeatureHole.cpp)
226 ms: Ui_TaskHoleParameters::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Mod/PartDesign/Gui/TaskHoleParameters.cpp)
224 ms: SketcherGui::ElementView::contextMenuEvent(QContextMenuEvent*) (/home/joao/dev/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp)
224 ms: Sketcher::SketchObject::getSymmetric(std::__1::vector<int, std::__1:... (/home/joao/dev/FreeCAD/src/Mod/Sketcher/App/SketchObject.cpp)
224 ms: App::FunctionExpression::evaluate(App::Expression const*, int, std::... (/home/joao/dev/FreeCAD/src/App/Expression.cpp)
215 ms: Gui::Dialog::Ui_DlgSettingsDocument::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Gui/PreferencePages/DlgSettingsDocumentImp.cpp)
209 ms: SketcherGui::TaskSketcherElements::slotElementsChanged() (/home/joao/dev/FreeCAD/src/Mod/Sketcher/Gui/TaskSketcherElements.cpp)
209 ms: MeshGui::Ui_DlgEvaluateMesh::setupUi(QDialog*) (/home/joao/dev/FreeCAD/src/Mod/Mesh/Gui/DlgEvaluateMeshImp.cpp)
192 ms: Gui::Dialog::Ui_DlgSettingsNavigation::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Gui/PreferencePages/DlgSettingsNavigation.cpp)
184 ms: Part::TopoShape::makeElementOffset2D(Part::TopoShape const&, double,... (/home/joao/dev/FreeCAD/src/Mod/Part/App/TopoShapeExpansion.cpp)
183 ms: Sketcher::SketchObject::addCopy(std::__1::vector<int, std::__1::allo... (/home/joao/dev/FreeCAD/src/Mod/Sketcher/App/SketchObject.cpp)
177 ms: Gui::Dialog::Ui_DlgSettings3DView::setupUi(QWidget*) (/home/joao/dev/FreeCAD/src/Gui/PreferencePages/DlgSettings3DViewImp.cpp)
176 ms: Part::TopoShape::makeShapeWithElementMap(TopoDS_Shape const&, Part::... (/home/joao/dev/FreeCAD/src/Mod/Part/App/TopoShapeExpansion.cpp)
174 ms: PartDesign::SubShapeBinder::update(PartDesign::SubShapeBinder::Updat... (/home/joao/dev/FreeCAD/src/Mod/PartDesign/App/ShapeBinder.cpp)
156 ms: PartDesign::Helix::execute() (/home/joao/dev/FreeCAD/src/Mod/PartDesign/App/FeatureHelix.cpp)
156 ms: App::FeatureTest::FeatureTest() (/home/joao/dev/FreeCAD/src/App/FeatureTest.cpp)
154 ms: Gui::TreeWidget::contextMenuEvent(QContextMenuEvent*) (/home/joao/dev/FreeCAD/src/Gui/Tree.cpp)
153 ms: App::DocumentObserverPython::DocumentObserverPython(Py::Object const&) (/home/joao/dev/FreeCAD/src/App/DocumentObserverPython.cpp)
**** Function sets that took longest to compile / optimize:
11561 ms: void fmt::v9::detail::vprintf<$>(fmt::v9::detail::buffer<$>&, fmt::v... (239 times, avg 48 ms)
11141 ms: fmt::v9::appender fmt::v9::detail::write_int_noinline<$>(fmt::v9::ap... (717 times, avg 15 ms)
10830 ms: void fmt::v9::detail::convert_arg<$>(fmt::v9::basic_format_arg<$>&, ... (1434 times, avg 7 ms)
6699 ms: fmt::v9::detail::format_dragon(fmt::v9::detail::basic_fp<$>, unsigne... (239 times, avg 28 ms)
4150 ms: std::__1::reverse_iterator<$> std::__1::__uninitialized_allocator_mo... (1160 times, avg 3 ms)
3428 ms: std::__1::vector<$>::~vector[abi:ne180100]() (1868 times, avg 1 ms)
3395 ms: fmt::v9::appender fmt::v9::detail::do_write_float<$>(fmt::v9::append... (239 times, avg 14 ms)
3013 ms: int fmt::v9::detail::parse_header<$>(char const*&, char const*, fmt:... (239 times, avg 12 ms)
2956 ms: std::__1::vector<$>::vector[abi:ne180100]() (1496 times, avg 1 ms)
2862 ms: std::__1::vector<$>::max_size() const (1399 times, avg 2 ms)
2797 ms: int fmt::v9::detail::format_float<$>(double, int, fmt::v9::detail::f... (239 times, avg 11 ms)
2527 ms: fmt::v9::appender fmt::v9::detail::format_uint<$>(fmt::v9::appender,... (717 times, avg 3 ms)
2510 ms: fmt::v9::appender fmt::v9::detail::write_padded<$>(fmt::v9::appender... (924 times, avg 2 ms)
2488 ms: std::__1::__split_buffer<$>::~__split_buffer() (1169 times, avg 2 ms)
2440 ms: char* fmt::v9::detail::format_uint<$>(char*, unsigned __int128, int,... (717 times, avg 3 ms)
2424 ms: fmt::v9::appender fmt::v9::detail::write_padded<$>(fmt::v9::appender... (920 times, avg 2 ms)
2387 ms: std::__1::__allocation_result<$> std::__1::__allocate_at_least[abi:n... (1452 times, avg 1 ms)
2363 ms: opencascade::type_instance<$>::get() (807 times, avg 2 ms)
2294 ms: std::__1::__tree<$>::destroy(std::__1::__tree_node<$>*) (840 times, avg 2 ms)
2253 ms: fmt::v9::appender fmt::v9::detail::write_padded<$>(fmt::v9::appender... (920 times, avg 2 ms)
2252 ms: boost::multi_index::detail::hashed_index<$>::hashed_index(boost::tup... (451 times, avg 4 ms)
2171 ms: std::__1::unique_ptr<$> std::__1::__tree<$>::__construct_node<$>(std... (574 times, avg 3 ms)
2154 ms: std::__1::vector<$>::__swap_out_circular_buffer(std::__1::__split_bu... (1062 times, avg 2 ms)
2032 ms: std::__1::__to_address_helper<$>::__call[abi:ne180100](std::__1::rev... (1209 times, avg 1 ms)
2007 ms: std::__1::basic_ostream<$>& std::__1::__put_character_sequence[abi:n... (317 times, avg 6 ms)
1980 ms: opencascade::handle<$>::~handle() (1345 times, avg 1 ms)
1973 ms: fmt::v9::basic_memory_buffer<$>::grow(unsigned long) (702 times, avg 2 ms)
1940 ms: int fmt::v9::detail::format_float<$>(long double, int, fmt::v9::deta... (239 times, avg 8 ms)
1825 ms: std::__1::__compressed_pair_elem<$>::__get[abi:ne180100]() (384 times, avg 4 ms)
1783 ms: std::__1::__split_buffer<$>::__split_buffer(unsigned long, unsigned ... (1097 times, avg 1 ms)
**** Expensive headers:
3407237 ms: /home/joao/dev/FreeCAD/src/App/DocumentObject.h (included 1033 times, avg 3298 ms), included via:
161x: <direct include>
42x: CommandT.h
41x: View3DInventorViewer.h Selection.h
31x: DocumentObjectPy.h
22x: Selection.h
20x: Origin.h Datums.h GeoFeature.h
...
2140363 ms: /home/joao/dev/FreeCAD/src/App/Application.h (included 1193 times, avg 1794 ms), included via:
132x: <direct include>
129x: Application.h
50x: Application.h QPixmap
34x: Origin.h Datums.h GeoFeature.h ComplexGeoData.h ElementMap.h
28x: Command.h Application.h
25x: QApplication
...
2110926 ms: /home/joao/dev/FreeCAD/src/boost_signals2.hpp (included 1098 times, avg 1922 ms), included via:
100x: Application.h
92x: Tools.h
36x: Application.h Application.h
26x: Application.h QPixmap Application.h
25x: QApplication Application.h
22x: DocumentObject.h PropertyExpressionEngine.h
...
1874717 ms: /home/joao/dev/FreeCAD/src/App/GeoFeature.h (included 746 times, avg 2513 ms), included via:
42x: Origin.h Datums.h
36x: <direct include>
36x: SketchObject.h FeaturePython.h
34x: MeshFeature.h FeaturePython.h
33x: DocumentObjectGroup.h FeaturePython.h
32x: PartFeature.h FeaturePython.h
...
1517070 ms: /usr/include/boost/signals2/connection.hpp (included 1497 times, avg 1013 ms), included via:
100x: Application.h boost_signals2.hpp signals2.hpp signal.hpp
92x: Tools.h boost_signals2.hpp signals2.hpp signal.hpp
79x: Document.h PropertyLinks.h Property.h signals2.hpp signal.hpp
34x: Application.h Application.h boost_signals2.hpp signals2.hpp signal.hpp
26x: Application.h QPixmap Application.h boost_signals2.hpp signal.hpp
22x: DocumentObject.h PropertyExpressionEngine.h boost_signals2.hpp signals2.hpp signal.hpp
...
1385474 ms: /usr/lib/llvm-18/include/c++/v1/functional (included 2186 times, avg 633 ms), included via:
133x: sstream istream ostream format container_adaptor.h queue deque
126x: QApplication qapplication.h qcoreapplication.h qstring.h qlist.h qhashfunctions.h qpair.h
70x: QAction qaction.h qkeysequence.h qobject.h qlist.h qhashfunctions.h qpair.h
47x: QMessageBox qmessagebox.h qdialog.h qwidget.h qobject.h qstring.h qhashfunctions.h qpair.h
45x: Console.h chrono forward_list
34x: QMenu qmenu.h qwidget.h qobject.h qstring.h qhashfunctions.h qpair.h
...
1342924 ms: /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QApplication (included 521 times, avg 2577 ms), included via:
153x: <direct include>
26x: QAction
16x: SoCamera.h
8x: GuiApplicationNativeEventAware.h
7x: ui_DlgReference.h
6x: ui_TaskPadPocketParameters.h
...
1341677 ms: /usr/lib/llvm-18/include/c++/v1/iostream (included 1002 times, avg 1338 ms), included via:
62x: Document.h Objects.hxx WrapPython.h Objects.hxx
39x: Tools.h
32x: TopoDS.hxx Standard_Handle.hxx Standard_Stream.hxx
28x: meta-iostreams.h
22x: GeometryPyCXX.h Extensions.hxx WrapPython.h Extensions.hxx Objects.hxx
20x: <direct include>
...
1300098 ms: /home/joao/dev/FreeCAD/src/Base/Console.h (included 1633 times, avg 796 ms), included via:
361x: <direct include>
109x: Application.h Observer.h
93x: Document.h Observer.h
42x: Application.h Application.h Observer.h
41x: QApplication Observer.h
36x: QMessageBox Observer.h
...
1246988 ms: /usr/lib/llvm-18/include/c++/v1/string (included 2203 times, avg 566 ms), included via:
133x: sstream istream ostream error_code.h error_category.h
124x: QApplication qapplication.h qcoreapplication.h qstring.h qchar.h
66x: QAction qaction.h qkeysequence.h qstring.h qchar.h
47x: QMessageBox qmessagebox.h qdialog.h qwidget.h qobject.h qstring.h qchar.h
45x: Console.h chrono forward_list functional boyer_moore_searcher.h vector formatter_bool.h formatter_integral.h formatter_output.h parser_std_format_spec.h
34x: QMenu qmenu.h qwidget.h qobject.h qstring.h qchar.h
...
done in 9.2s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment