Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Optimization of the build times using Conan
1. Optimize build time for legacy code with the Conan
package manager
Florentin Picioroaga
IDS GmbH, Ettlingen, Germany
filo.rom@gmail.com
January 30, 2020
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 1 / 15
2. Overview
1 Motivation
2 Conan Package Manager
3 Requirements on legacy code to use Conan
4 Case study: IDS Software
Software structure changes
Build process
Benefits using Conan
Compile time optimization
Build time optimization
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 2 / 15
3. Motivation
Continuous Integration for legacy C++ Code
Fast feedback on the build
Transparency for the build results
Use easily the latest deliverables
Faster Daily Builds
Cleaner software architecture
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 3 / 15
4. Conan Package Manager
The open source, decentralized and multi-platform package
manager to create and share all your native binaries.
Full binaries management for any configuration: platform, compiler,
version, architectures
Fully automated dependency management: transitive dependencies,
conflicts detection, dependencies overriding, conditional dependencies
Decentralized client-server system
Python based: easy to update with PIP (Python Package Manager)
Great support
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 4 / 15
5. Requirements on legacy code to use Conan
Modular software structure
No cycles between software modules
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 5 / 15
6. Requirements on legacy code to use Conan
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 6 / 15
7. Case study IDS: Software structure changes
Separate module’s API:
increased developer’s
awareness on the
software architecture
module dependencies in
source files:
before:
#include <1.hpp>
after: #include <
module1/1.hpp>
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 7 / 15
8. Case study IDS: Software structure changes
Maintain module’s dependencies with Conan:
1 from conans import p y t h o n r e q u i r e s
2
3 base = p y t h o n r e q u i r e s ( ” i d s c o n a n b a s e /1.4 @ids / dev ” )
4 c o n f i g u r a t i o n = p y t h o n r e q u i r e s ( ” i d s c o n a n c o n f i g u r a t i o n /1.1 @ids /
dev ” )
5
6
7 c l a s s L i b i d s t r a c e C o n a n ( base . Idsconanbase ) :
8 # package i n f o r m a t i o n
9 name = ” l i b i d s t r a c e ”
10 v e r s i o n = c o n f i g u r a t i o n . g e t v e r s i o n ()
11 s e t t i n g s = ” os ” , ” c o m p i l e r ” , ” b u i l d t y p e ” , ” arch ”
12 package type = ” b u i l d ”
13
14 # package dependencies
15 def r e q u i r e m e n t s ( s e l f ) :
16 s e l f . add dependency ( ” l i b i d s b a s i s ” )
17 s e l f . add dependency ( ” l i b i d s c r w ” )
18 s e l f . add dependency ( ” l i b i d s o s ” )
19 s e l f . add 3rdparty dependency ( ” v l d ” , ” 2 . 2 . 3 ” )
20 s e l f . add 3rdparty dependency ( ” r w t o o l s ” , ” 5.0 ” )
21 s e l f . add 3rdparty dependency ( ” boost ” , ” 1.69 ” )
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 8 / 15
9. Case study IDS: Build process
Use case: developer working in a module.
Make
checkout entire code base
build all modules
for source code change
build module
Conan
checkout module
for source code change
Conan install dependencies
build the module
Conan export binary package
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 9 / 15
10. Case study IDS: Build process
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 10 / 15
11. Benefits using Conan
build anytime any software module
easy to work in parallel for different features: maintenance costs per
source tree are minimum
easy to setup CI, module dependencies now available in Conan
use easily the latest deliverables
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 11 / 15
12. Case study IDS: Compile time optimization
1 use of precompiled headers
2 code generators update only files that changed
3 optimize the order of include directories, network access is expensive
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 12 / 15
13. Case study IDS: Build time optimization
IDS software: 348 modules, 7674 object files
Operation Before With Conan
DailyBuild 4:30h 2:30h
First build on module 2h 5-30min
Commit buildable? next day in avg<30min
Florentin Picioroaga (IDS GmbH) Build time optimization with Conan January 30, 2020 13 / 15