The Most Important Design Guideline is Testability77Rewrite; Power Peg Moved, Not Removed 78Did Not Retest Power Peg 79Deploy Version to Support RLP 80Manual Deployment Mistake 81No Review or Test of Deployment 82RLP Goes Live on 7 Servers 83Power Peg Peg in 2003, dead code still around •Refactored code in 2005 ; moved dead code ; test still pass •Manual deployment ; no review ; no tests •Different components had different view of same thing •email Peg in 2003, dead code still around •Refactored code in 2005 ; moved dead code ; test still pass •Manual deployment ; no review ; no tests •Different components had different view of same thing •email0 码力 | 126 页 | 9.11 MB | 6 月前3
Tracy: A Profiler You Don't Want to MissProfiling Zoo holistic (automatic) issues: information overload; profiling overhead (skew) selective (manual) Sampling callstack snapshot probing system-wide automatic (regular intervals) OS kernel events Profiling Zoo holistic (automatic) issues: information overload; profiling overhead (skew) selective (manual) Sampling callstack snapshot probing system-wide automatic (regular intervals) OS kernel events TracyClient.cpp TracyClient.cpp TracyClient.cpp TracyClient.cpp Behold the Tracy Multiverse! (Tracy Manual, Section 2.1.5)18 Tracy integration across shared libraries tracy (shared library) TracyClient0 码力 | 85 页 | 6.51 MB | 6 月前3
Tracy: A Profiler You Don't Want to MissProfiling Zoo holistic (automatic) issues: information overload; profiling overhead (skew) selective (manual) Sampling callstack snapshot probing system-wide automatic (regular intervals) OS kernel events Profiling Zoo holistic (automatic) issues: information overload; profiling overhead (skew) selective (manual) Sampling callstack snapshot probing system-wide automatic (regular intervals) OS kernel events ZoneScoped; ... } ... { ZoneScoped; ... } }23 Tracy manual, Section 3.1 Tracy Zoning 101 int foo() { ZoneScoped; ... if (!spoon) { Zo0 码力 | 84 页 | 8.70 MB | 6 月前3
Applicative: The Forgotten Functional PatternPARAPHRASING P2561 "How is this problem solved today? Either: "How is this problem solved today? Either: manual error propagation macros (most libraries e.g. Boost.Outcome) The only things that have nice syntax multiple (possibly failing) values. to multiple (possibly failing) values. Goals: Goals: no macros no manual control �ow declarative expression-oriented style good-looking code e�cient Let's do it with Let's return std::format("{}{}", f, b); }); }); } 37HOW DID WE DO? HOW DID WE DO? No macros? No manual control �ow? Declarative style? Good-looking code? E�cient? 38APPLICATIVE SOLUTION APPLICATIVE0 码力 | 141 页 | 11.33 MB | 6 月前3
jsc::chunk_evenly Range Adaptor for Distributing Work Across Tasks了 了 struct chunk { std: :ptrdiff_t begin; std::ptrdiff_t end; }; auto func (chunk) -> void; auto manual_loop (std: :ptrdiff_t n,std::ptrdiff_t chunk_count) -> void [[assumeCn >= 0)]]; [[assume(chunk_count 一Range adaptorfor dlstributing work across tasks (CZ) ASM comparison > GCC RISC-V 64-bit assembly manual_loop(long,long): jsc-chunk_evenly (long,long): addiji sp,sp,-64 sp,sSp,64 j工 Ia CP and LCD comparison 1o0恒 80 60 40 20 上 manual 1oop jsc: :chunk_evenly() 大 manual loop 时 jsc: :chunk_evenly() 50 40 30 20 10 WE W 和中0 码力 | 1 页 | 1.38 MB | 6 月前3
Cooperative C++ EvolutionSource breaking change (can’t compile 2 as 3) Python 2 Python 3 x = 3/2 x == 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python Source breaking change (can’t compile 2 as 3) Python 2 Python 3 x = 3/2 x == 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python Source breaking change (can’t compile 2 as 3) Python 2 Python 3 x = 3/2 x == 2 x == 1.5 Manual migration + tools (2to3, Pylint, Futurize, Modernize, caniusepython3, tox, mypy) 2017: Most Python0 码力 | 85 页 | 5.73 MB | 6 月前3
Au Unitssecond)(8.0) 8.0_mps // New manual definition 😞 38.1Unit symbol APIs (e.g., literals) Functions UDLs meters(3.0) 3.0_m (meters / second)(8.0) 8.0_mps // New manual definition 😞 meters(3.0f) ? APIs (e.g., literals) Functions UDLs meters(3.0) 3.0_m (meters / second)(8.0) 8.0_mps // New manual definition 😞 meters(3.0f) ??? meters(dist_m) ??? 38.3Unit symbol APIs (e.g., literals) Functions Functions UDLs Unit Symbols meters(3.0) 3.0_m 3.0 * m (meters / second)(8.0) 8.0_mps // New manual definition 😞 8.0 * m / s meters(3.0f) ??? 3.0f * m meters(dist_m) ??? dist_m * m 38.4Inter-library0 码力 | 191 页 | 22.37 MB | 6 月前3
Making Libraries Consumable for Non-C++ Developersstd::shared_ptr- Python - Objective-C (manual or automatic – see ARC) - Swift - COM – AddRef()/Release() - Non-Reference counted - .NET - JVM - JavaScript Manual memory management is rarely advocated advocated for anymore.Memory model – Manual Memory is allocated and deallocated directly. Allocation locations are static. ptr = new int[10]; // 0x2600 ptr delete[] ; // 0x2600 Could have been deleted 0 码力 | 29 页 | 1.21 MB | 6 月前3
Mastering C++ Modulesdyndep https://ninja-build.org/manual.html#ref_dyndep • May 2019 ninja merged all of the changes to support Fortran because of C++ modules! 16https://ninja-build.org/manual.html#ref_dyndep Some use cases hoffman@kitware.com • Read “how to write a CMake buildsystem” – https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html/Explore the CMake documentation • Explore the CMake documentation – https://www0 码力 | 77 页 | 9.07 MB | 6 月前3
Taming the C++ Filter Viewof end() end() begin() ++ pos end() begin() filter ++ pos ©2024 by josuttis.com 34 C++ • Manual iteration: 5 6 8 7 0 1 3 4 2 14 9 10 11 12 13 20 21 22 23 15 16 17 18 19 29 24 25 27 28 26 end() pos Nico Josuttis C++ Filter View @cppcon 2024-09-17 19©2024 by josuttis.com 39 C++ • Reverse manual iteration: 5 6 8 7 0 1 3 4 2 14 9 10 11 12 13 20 21 22 23 15 16 17 18 19 29 24 25 27 28 26 end() One call of end() begin() end() reverse on filter -- pos ©2024 by josuttis.com 40 C++ • Reverse manual iteration: 5 6 8 7 0 1 3 4 2 14 9 10 11 12 13 20 21 22 23 15 16 17 18 19 29 24 25 27 28 26 end()0 码力 | 43 页 | 2.77 MB | 6 月前3
共 107 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11













