Looking at software from a different angle as done during profiling and data analysis has numerous benefits. It requires and increases our understanding of the problems being solved by the software. It exposes us to unexpected discoveries and insights. It allows us to suggest improvements.
Since there is a great element of skills involved, and it is rarely taught in Computer Science degrees, the role of practice is very important to gain the necessary skills.
Reading sequentially and processing each element from:
- Case 1: an array `Foo arr[N]`
- Case 2: an array `Foo *arr[N];` (pointers to “random” locations)
- Case 3: linked list of Foos.
- Order the cases
- Explain the ordering
- Measure
- https://www.icloud.com/keynote/05iUiTiZFlOBN7qZny3Vr8bfQ#Engine_programmers_should_know Engine programmers should know… (insights on practice, problem solving process and pitfalls)
- http://www.gdcvault.com/play/1021866/Code-Clinic-2015-How-to How to Write Code the Compiler Can Actually Optimize by Mike Acton (shows process of analyzing bottlenecks, i.e. finding the resource that is most in demand, verifying hypothesis. Value of analyzing one value and getting value distributions, the value of practice, and an example of that practice)
- https://fgiesen.wordpress.com/2018/03/05/a-whirlwind-introduction-to-dataflow-graphs/
- https://www.facebook.com/perftidbits/photos/pcb.504731853211324/504731296544713/?type=3&theater Performance by Design by Rico Mariani
- https://docs.google.com/presentation/d/1ST3mZgxmxqlpCFkdDhtgw116MQdCr2Fax2yjd8Az6zM/edit#slide=id.g238f34177c_0_82 OOP Pitfalls talk 2017 by Tony Albrecht
- https://shipilev.net/blog/2014/java-scala-divided-we-fail/ show that our formal and informal training as software engineers often leaves out holes in certain areas such as how to properly design and interpret an experiment. shows how “known inputs” can skew a benchmark in a certain direction and mislead.
- http://gpuopen.com/video-memory-profiling-wpa/
- https://bling.kapsi.fi/blog/x86-memory-access-visualization.html
- https://twitter.com/Reedbeta/status/828402842184486912 nice example of unicode usage visualisation
- http://stackoverflow.com/questions/29551516/glclear-takes-too-long-android-opengl-es-2/29553399#29553399 asynchronous APIs can be hard to profile
- https://fgiesen.wordpress.com/2013/02/17/optimizing-sw-occlusion-culling-index/ Fabian Giesen records his profiling+optimization work of an Intel library for occlusion culling
- https://macton.smugmug.com/Other/2008-07-30-by-Eye-Fi/n-qN9F8/i-Z2vc8sC On the importance of focusing on the data + final transform + actual contraints
- https://hero.handmade.network/episode/code/day112 A Mental Model of CPU Performance by Casey Muratori. (how to think about optimization/performance, CPU instruction level, exposure to vocabulary around lower-level optimizations, cycles / sec)
- https://gist.github.com/ocornut/cb980ea183e848685a36 Memory, Cache, CPU optimization resources (compiled by Omar Cornut + others)
- http://www.codercorner.com/blog/?page_id=1632 The Box Pruning Series
- https://gist.github.com/ocornut/cb980ea183e848685a36 Memory, Cache, CPU optimization resources (compiled by Omar Cornut + others
- https://youtu.be/gNsF8Q1Nh2Q?list=PLHxtyCq_WDLXFAEA-lYoRNQIezL_vaSX-&t=1538 Stepanov, Programming Conversations
- http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html CPU Utilization Is Wrong
- http://aras-p.info/blog/2017/08/08/Unreasonable-Effectiveness-of-Profilers/ An example of studying build times with a tracing profiler
- https://www.snellman.net/blog/archive/2017-08-19-slow-ps4-downloads/ Gives a good outlook of what a performance experiment design looks like, from the establishment of a mental model and hypothesis.
- https://www.youtube.com/watch?v=lJ8ydIuPFeU How NOT to measure Latency by Gil Tene
- https://www.facebook.com/notes/rico-marianis-performance-tidbits/a-brief-word-about-some-common-metrics/489778214706688/ Mach-O Metrics (Macos, IOS) and their usefulness
- https://www.facebook.com/perftidbits/photos/ms.c.eJw9zdsNwEAIA8GOIl4Hpv~;GIp3jfI5goWBlmDhd2TlPfcZO75jckW5pv~;POe~_VD~;~;3wXshLq4dz32X~_D~;VgH~_pRd~;9Abrpl0CUvnZ~;X7z3HC~;fpMSM~-.bps.a.480408715643638.1073741829.414843438866833/480408725643637/?type=3&theater Performance Troubleshooting Techniques: Keep big picture, Look for correlated resource comsumption (for ex Memory usage for a CPU usage increase) to drive analysis around a period of time
- http://www.art.net/~hopkins/Don/unix-haters/tirix/embarrassing-memo.html Memo about IRIX 5.1’s issues and how the team scrambled to address them after the fact
- http://ubiquity.acm.org/article.cfm?id=1513451 The Fallacy Of Premature Optimization
- https://www.youtube.com/watch?v=DxP–1yEgKQ toolbox and attitude towards performance. Peter Seinbach
- Paul Khuong https://twitter.com/pkhuong http://pvk.ca
- Mike Acton https://twitter.com/mike_acton http://www.macton.ninja/
- Fabian Giesen https://fgiesen.wordpress.com
- Brendan Gregg http://www.brendangregg.com
- Rico Mariani https://www.facebook.com/notes/rico-marianis-performance-tidbits/
From http://users.ece.utexas.edu/~adnan/pike.html:
- Rule 1. You can’t tell where a program is going to spend its time. Bottlenecks occur in surprising places, so don’t try to second guess and put in a speed hack until you’ve proven that’s where the bottleneck is.
- Rule 2. Measure. Don’t tune for speed until you’ve measured, and even then don’t unless one part of the code overwhelms the rest.
- Rule 3. Fancy algorithms are slow when n is small, and n is usually small. Fancy algorithms have big constants. Until you know that n is frequently going to be big, don’t get fancy. (Even if n does get big, use Rule 2 first.)
- Rule 4. Fancy algorithms are buggier than simple ones, and they’re much harder to implement. Use simple algorithms as well as simple data structures.
- Rule 5. Data dominates. If you’ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.
Software creation is often presented as the creation of a model that will run “in reality.”
This activity of profiling and analyzing data + code is about reversing that arrow:
From http://realworldrisk.com/:
When and if we model, we go from reality to models not from models to reality