C++ Con 2024: Amortized Complexity## Amortized $ \mathcal{O}(1) $ Complexity Andreas Weis CppCon 2024 $$ \blacksquare f\in\mathcal{O}(g)\iff\exists C>0.\exists x_{0}>0.\forall x>x_{0}:|f(x)|\leq C\cdot|g(x)| $$ Child's play! What is amortized complexity? The Design and Analysis of Computer Algorithms  What is amortized complexity? ![Image] A. A. What is amortized complexity?  # What is amortized complexity? # AMORTIZED COMPUTATIONAL COMPLEXITY $ ^{*} $ ROBEY0 码力 | 60 页 | 2.56 MB | 1 年前3
Algorithmic Complexity## Algorithmic Complexity Amir Kirsh & Adam Segoli Schubert ___  © All rights reserved ## Why this talk? ## Why this jpg) ## Algorithmic Complexity Performance is the name of the game ## Algorithmic Complexity It’s actually about something BIGGER than just performance ## Algorithmic Complexity What's BIGGER than performance? ## Algorithmic Complexity What's BIGGER than just performance? ## Scalability # Computational Complexity Computational Complexity or simply Complexity of an algorithm is the amount0 码力 | 52 页 | 1.01 MB | 1 年前3
Quantifying Accidental Complexity: An empirical look at teaching and using C++# Quantifying Accidental Complexity An empirical look at teaching and using C++ Herb Sutter ## Why complexity matters We’re “paying taxes” all the time Productivity Correctness and quality Tooling catalog, classify, and count ## Fred Brooks: Complexity ## Essential complexity Inherent in the problem, present in any solution ## Accidental complexity PUSH Artifact of a specific solution design today's complex thing, to explain how it maps to the simpler thing. Quantifying Accidental Complexity: An empirical look at teaching and using C++ Herb Sutter "Definite first/last use" (see0 码力 | 36 页 | 2.68 MB | 1 年前3
Neighborhoods Banding Together: Reasoning Globally about Programssapien, sed malesuada diam lacus eget erat. ## Local phase Validate small neighborhoods with high-complexity algorithms. Describe neighborhood interactions coarsely in small tables. ## Global phase Collate Collate the small tables into a big table of interactions. Validate the interactions with low-complexity algorithms. Indirect caller's interface fits many functions Function interface fits a specific0 码力 | 49 页 | 1.03 MB | 1 年前3
Back to Basics: Classic 9STLSemantically based interoperability guarantees ## • Efficient • No penalty for generality • Complexity guarantees at the interface level ## • Natural • C/C++ machine model and programming paradigm generality • Complexity guarantees at the interface level ## • Natural • C/C++ machine model and programming paradigm • Support for built-in data types ## The design principles: ## Complexity and the Big-O Big-O Notation • Complexity refers to the runtime cost of an algorithm • Big-O notation expresses the relative complexity of an algorithm |Type|Notation|Runtime Cost| |---|---|---| |Constant|O(1)|Independent0 码力 | 75 页 | 603.36 KB | 1 年前3
Taming the C++ Filter Viewconstant complexity – begin() has constant complexity – end() has constant complexity ## • Guarantees for Views – Initialization has constant complexity – begin() has amortized constant complexity – end() end() has amortized constant complexity C++20: [range.range]: Given an expression t such that decltype((t)) is T&, T models concept std::range only if (3.2) — both ranges ::begin(t) and ranges::end(t) ranges::end(t) are amortized constant time and non-modifying, C++ josuttis | eckstein C++20 # Consequences for Read Iterations C++ ©2024 by josuttis.com ## Processing Containers and Views C++200 码力 | 43 页 | 2.77 MB | 1 年前3
When Nanoseconds Matter: Ultrafast Trading Systems in C++levels.erase(it); } ## OrderBookMap – Complexity • AddOrder: $ \log(N) $ • ModifyOrder: amortized constant - std::map iterators are stable, which means we can store it it with our order data (in the hash table) • DeleteOrder: amortized constant - Same as above ## OrderBookMap Latencies  e507f502d0de5e6500/p67_2.jpg) ## Principle #6: “True efficiency is found not in the layers of complexity we add, but in the unnecessary layers we remove”  on insert amortized. - O(1) on erase amortized (regardless of location). Skipfields are used during iteration to skip empty blocks each game entity to determine if it exists inside the frustum. Does not scale well, O(N) time complexity. We need a data structure that represents the map in a way for us to search faster. ## Quadtrees Can’t be SIMD-ed. - Low occupancy on the GPU. But when you’re iterating large data sets, time complexity has higher importance. Regardless, we now have the list of entities that we can send to the GPU0 码力 | 196 页 | 3.03 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 6 - Advanced Learning Techniques - Technical Reviewmodel is intended to be generalizable across many downstream tasks, the cost of pre-training can be amortized amongst these tasks. BERT has been used across a large number of NLU tasks. Say we consider the linearly or exponentially to reach a value of 1.0 in the final epoch. It controls when and how much complexity you want to introduce in the training. Figure 6-12 shows multiple examples of pacing functions0 码力 | 31 页 | 4.03 MB | 2 年前3
Golang Manual By AstaXie-20120522of typing in both senses of the word. Throughout its design, we have tried to reduce clutter and complexity. There are no forward declarations and no header files; everything is declared exactly once. Initialization convenient but they come at a cost in complexity in the type system and run-time. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about handle the reference form of arrays, resolved these issues. Reference types add some regrettable complexity to the language but they have a large effect on usability: Go became a more productive, comfortable0 码力 | 6205 页 | 12.83 MB | 2 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100
相关搜索词
amortized complexityamortized analysispotential methodaccounting methodaggregate analysis算法复杂度时间复杂度空间复杂度摊还复杂度内存局部性accidental complexityC++complexitysimplificationreductionNeighborhoodsLocal reasoningHigh-complexity algorithmsGlobal phaseLow-complexity algorithmsSTL迭代器容器算法容器接口Filter Viewscall-by-valuecall-by-referenceLazy EvaluationPipelinesUltra low-latency executionOptiver低延迟系统量化交易树结构四叉树八叉树网格划分资源 registry自监督学习标签平滑课程学习子类蒸馏随机深度Golang并发垃圾回收类型系统模块化













