Why is my Build so SlowWhy is my build so slow? Sam Privett 12 Disclaimer: The views and opinions expressed in this presentation are solely those of the presenters and do not necessarily represent the views, positions, Level 6. Higher Order 7. Takeaways 8. Questions 3Introduction 4 High Level ConceptsAbout Me - Sam Privett (He/Him) - Robotics Software Engineer @ JnJ - Curious about compilers 5What is this talk engineer a hugThank You! 67 https://github.com/maspe36/WhyIsMyBuildSoSlow https://www.linkedin.com/in/sam-privett/careers.jnj.com 68Questions? 69 TakeawaysGCC Profiling 70 - Externis, GCC Plugin “similar”0 码力 | 71 页 | 3.96 MB | 6 月前3
Back to Basics Unit Testinghttps://youtu.be/RoYljVOj2H8 2020: Ben Saks https://youtu.be/_OHE33s7EKw 2022: Amir Kirsh https://youtu.be/SAM4rWaIvUQ 2023: Phil Nash https://youtu.be/7_H4qzhWbnQ 103Unit Testing is a Big Topic So many0 码力 | 109 页 | 4.13 MB | 6 月前3
Calling Functions A Tutorialmatch from the overload set of candidate functions. If necessary, apply some necessary argument conversions.Overview 10 Template Argument Deduction Name Lookup Overload Resolution Access Labels Access with a single 'int' argument } // Exact/identity match // Trivial conversions // Standard conversions // User-defined conversions // Default arguments // Less parameters than arguments // More parameters Trivial conversion (rank 1)Identity Match vs. Trivial Conversions 52Identity Match vs. Trivial Conversions 53Identity Match vs. Trivial Conversions 54Ranking 55 void f( int& ); // (1) void0 码力 | 111 页 | 5.11 MB | 6 月前3
Back to Basics: Designing Classes (part 2 of 2)Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member0 码力 | 76 页 | 2.60 MB | 6 月前3
Back to Basics - Function Call Resolutionarguments. 13 Argument Conversions The type of each parameter need not be exactly the same as the type of its corresponding argument. C++ compilers apply some conversions in an attempt to find a 14Back to Basics - Function Call Resolution Copyright © 2024 by Ben Saks and Dan Saks Argument Conversions int put(int c); // write c to standard output int put(int c, FILE *f); // write Ambiguities When confronted with a choice of functions: Overload resolution uses a ranking of the conversions from the argument type into the parameter type. The ranking helps determine which function0 码力 | 44 页 | 1.30 MB | 6 月前3
Overload Resolutioncalling the expected overload ○ however, it can get complicated very fast . . . ○ data type conversions can be messy ○ pointer / reference data types may not resolve as expected ○ template functions value categories (31 pages) ■ declarations (45 pages) ■ standard conversions (15 pages) ■ user defined conversions (25 pages) ■ template argument deduction (80 pages) ■ SFINAE (35 pages) passed arguments can not be converted to match the declaration ■ even when considering implicit conversions doThing(38); void doThing(); // candidate A void doThing(int);0 码力 | 55 页 | 209.57 KB | 6 月前3
A Physical Units Library for the Next C++library in a nutshell 5// simple numeric operations static_assert(10_q_km / 2 == 5_q_km); // unit conversions static_assert(1_q_h == 3600_q_s); static_assert(1_q_km + 1_q_m == 1001_q_m); CppCon 2020 | A Physical static_assert(10_q_km / 2 == 5_q_km); // unit conversions static_assert(1_q_h == 3600_q_s); static_assert(1_q_km + 1_q_m == 1001_q_m); // dimension conversions static_assert(1_q_km / 1_q_s == 1000_q_m_per_s); Support for multiple units and unit prefixes • No runtime overhead – no additional intermediate conversions – as fast as a custom code implemented with doubles CppCon 2020 | A Physical Units Library For0 码力 | 172 页 | 6.17 MB | 6 月前3
Back to Basics: Designing Classes (part 1 of 2)Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member Basics: Class Design (Part 2) Implementation Guidelines Data Member Initialization Implicit Conversions Order of Data Members Const Correctness Encapsulating Design Decisions Qualified/Modified Member0 码力 | 87 页 | 5.64 MB | 6 月前3
Improving Our Safety With a Quantities and Units Libraryfirst-factor finding function • P2509: A proposal for a type trait to detect value-preserving conversions CppCon 2024: Improving our safety with a quantities and units library ISO C++ papers ASSOCIATED first-factor finding function • P2509: A proposal for a type trait to detect value-preserving conversions CppCon 2024: Improving our safety with a quantities and units library ISO C++ papers ASSOCIATED TTG: 2.68432 s CppCon 2024: Improving our safety with a quantities and units library Safe unit conversions with mp-units NO UNITS LIBRARY MP-UNITS 28const double distance_m = 30.; const double speed_mph0 码力 | 207 页 | 6.93 MB | 6 月前3
Powered by AI: A Cambrian Explosion for C++ Software Development Toolsconverted to any pointer type. Here `f` has overloads for `void*` and `char*`, which both are valid conversions for nullptr, so when you call `f(t)`, where `t` is `nullptr`, the compiler isn't sure which overload converted to any pointer type. Here `f` has overloads for `void*` and `char*`, which both are valid conversions for nullptr, so when you call `f(t)`, where `t` is `nullptr`, the compiler isn't sure which overload converted to any pointer type. Here `f` has overloads for `void*` and `char*`, which both are valid conversions for nullptr, so when you call `f(t)`, where `t` is `nullptr`, the compiler isn't sure which overload0 码力 | 128 页 | 23.40 MB | 6 月前3
共 58 条
- 1
- 2
- 3
- 4
- 5
- 6













