4 links
tagged with all of: algorithms + performance
Click any tag below to further narrow down your results
Links
The article explores the inefficiencies of binary search trees in file system applications, particularly when accounting for disk I/O latency. It contrasts this with B-trees, which optimize search performance by reducing the number of disk reads required, making them superior for managing large datasets in real-world scenarios. The author supports the argument with practical benchmarks demonstrating how B-trees maintain consistent performance where binary trees fail.
Big O notation provides a framework for analyzing the performance of functions based on how their execution time grows with increasing input size. The article discusses four common categories of Big O notation: constant (O(1)), logarithmic (O(log n)), linear (O(n)), and quadratic (O(n^2)), explaining their implications through examples such as summation, sorting, and searching algorithms. It emphasizes the importance of understanding these complexities to optimize code performance effectively.
Branchless programming eliminates control flow branches in code to enhance performance by avoiding costly pipeline flushes in modern CPUs. By using arithmetic and bit manipulation instead of conditional jumps, programmers can create more efficient algorithms, especially in performance-critical applications. The article provides examples in C, demonstrating the advantages of branchless code for operations like calculating absolute values, clamping values, and partitioning arrays.
Performance optimization is a complex and brute-force task that requires extensive trial and error, as well as deep knowledge of algorithms and their interactions. The author expresses frustration with the limitations of compilers and the challenges posed by incompatible optimizations and inadequate documentation, particularly for platforms like Apple Silicon. Despite these challenges, the author finds value in the process of optimization, even when it yields only marginal improvements.