<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Blog on Chris Kennelly</title>
		<link>https://ckennelly.com/blog/</link>
		<description>Recent content in Blog on Chris Kennelly</description>
		<generator>Hugo</generator>
		<language>en</language>
		
		
		
		
			<lastBuildDate>Thu, 27 Nov 2025 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://ckennelly.com/blog/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Performance Tip of the Week #99: Illuminating the processor core with llvm-mca</title>
				<link>https://ckennelly.com/blog/illuminating-the-processor-core-with-llvm-mca/</link>
				<pubDate>Tue, 07 Oct 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/illuminating-the-processor-core-with-llvm-mca/</guid>
				<description>&lt;p&gt;The &lt;a href=&#34;https://en.wikipedia.org/wiki/Reduced_instruction_set_computer&#34;&gt;RISC&lt;/a&gt;&#xA;versus &lt;a href=&#34;https://en.wikipedia.org/wiki/Complex_instruction_set_computer&#34;&gt;CISC&lt;/a&gt;&#xA;debate ended in a draw: Modern processors decompose instructions into&#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/Micro-operation&#34;&gt;micro-ops&lt;/a&gt; handled by backend&#xA;execution units. Understanding how instructions are executed by these units can&#xA;give us insights on optimizing key functions that are backend bound. In this&#xA;episode, we walk through using&#xA;&lt;a href=&#34;https://llvm.org/docs/CommandGuide/llvm-mca.html&#34;&gt;&lt;code&gt;llvm-mca&lt;/code&gt;&lt;/a&gt; to analyze&#xA;functions and identify performance insights from its simulation.&lt;/p&gt;&#xA;&lt;h2 id=&#34;preliminaries-varint-optimization&#34;&gt;Preliminaries: Varint optimization&lt;/h2&gt;&#xA;&lt;p&gt;&lt;code&gt;llvm-mca&lt;/code&gt;, short for Machine Code Analyzer, is a tool within LLVM. It uses the&#xA;same datasets that the compiler uses for making instruction scheduling&#xA;decisions. This ensures that improvements made to compiler optimizations&#xA;automatically flow towards keeping &lt;code&gt;llvm-mca&lt;/code&gt; representative. The flip side is&#xA;that the tool is only as good as LLVM&amp;rsquo;s internal modeling of processor designs,&#xA;so certain quirks of individual microarchitecture generations might be omitted.&#xA;It also models the processor &lt;a href=&#34;#limitations&#34;&gt;behavior statically&lt;/a&gt;, so cache&#xA;misses, branch mispredictions, and other dynamic properties aren&amp;rsquo;t considered.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #98: Measurement has an ROI</title>
				<link>https://ckennelly.com/blog/measurement-has-an-roi/</link>
				<pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/measurement-has-an-roi/</guid>
				<description>&lt;p&gt;Effectively measuring optimization projects is an important part of the&#xA;&lt;a href=&#34;https://ckennelly.com/blog/optimizing-optimization/&#34;&gt;lifecycle of an optimization&lt;/a&gt;. Overlooking a large positive (or&#xA;negative) &lt;a href=&#34;https://ckennelly.com/blog/spooky-action-at-a-distance/&#34;&gt;externality&lt;/a&gt; can cause us to make the wrong decisions for&#xA;choosing our next steps and future projects. Nevertheless, this quest for&#xA;accuracy needs to be balanced against the ROI from a better measurement. In this&#xA;episode, we discuss strategies for deciding when to invest more time in&#xA;measuring a project and when to move on.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #97: Virtuous ecosystem cycles</title>
				<link>https://ckennelly.com/blog/virtuous-ecosystem-cycles/</link>
				<pubDate>Thu, 27 Nov 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/virtuous-ecosystem-cycles/</guid>
				<description>&lt;p&gt;Software ecosystems aim to maximize qualities like efficiency, correctness, and&#xA;reliability while minimizing the costs of achieving these properties. Improving&#xA;a single service through customization can help build an optimization more&#xA;expediently, but it has an inherent limited scope to its upside and increases&#xA;technical debt. A point solution fails to provide the full benefits&#xA;from applying features horizontally. In this episode, we discuss how lessons&#xA;learned from partnerships to improve individual applications can improve&#xA;efficiency for everyone.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #95: Spooky action at a distance</title>
				<link>https://ckennelly.com/blog/spooky-action-at-a-distance/</link>
				<pubDate>Mon, 14 Jul 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/spooky-action-at-a-distance/</guid>
				<description>&lt;p&gt;Shared resources can cause surprising performance impacts on seemingly unchanged&#xA;software. In this episode, we discuss how to anticipate these effects and&#xA;externalities.&lt;/p&gt;&#xA;&lt;h2 id=&#34;normalization-techniques&#34;&gt;Normalization techniques&lt;/h2&gt;&#xA;&lt;p&gt;Workload changes can confound longitudinal analysis: If you optimize a library&#xA;like protocol buffers, does spending more time in that code mean your&#xA;optimization didn&amp;rsquo;t work or that the application now serves more load?&lt;/p&gt;&#xA;&lt;p&gt;A/B tests can control for independent variables. Nevertheless, load balancing&#xA;can throw a wrench into this. A client-side load balancing algorithm (like&#xA;&lt;a href=&#34;https://sre.google/sre-book/load-balancing-datacenter/&#34;&gt;Weighted Round Robin&lt;/a&gt;)&#xA;might observe the better performance of some tasks and send more requests to&#xA;them.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #94: Decision making in a data-imperfect world</title>
				<link>https://ckennelly.com/blog/decision-making-in-a-data-imperfect-world/</link>
				<pubDate>Fri, 27 Jun 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/decision-making-in-a-data-imperfect-world/</guid>
				<description>&lt;p&gt;Profiling tools are vital to narrowing the search space of all possible changes&#xA;we could make to highlight the best uses of our time. In this episode, we&#xA;discuss strategies for identifying when we might want to seek out more data and&#xA;when we are in the midst of diminishing returns.&lt;/p&gt;&#xA;&lt;h2 id=&#34;focusing-on-outcomes&#34;&gt;Focusing on outcomes&lt;/h2&gt;&#xA;&lt;p&gt;The ultimate outcomes that we want from our tools are insights that let us&#xA;improve performance.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #93: Robots never sleep</title>
				<link>https://ckennelly.com/blog/robots-never-sleep/</link>
				<pubDate>Tue, 03 Jun 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/robots-never-sleep/</guid>
				<description>&lt;p&gt;Techniques like presubmits are essential tools for effective software&#xA;engineering. For performance optimization, changing observable but unspecified&#xA;behaviors can be a large source of opportunities. In this episode, we discuss&#xA;strategies for leaning on automation and additional tools to make it easier to&#xA;evolve software.&lt;/p&gt;&#xA;&lt;h2 id=&#34;prevent-problems-via-technical-means&#34;&gt;Prevent problems via technical means&lt;/h2&gt;&#xA;&lt;p&gt;Use technical means, rather than (eventually fallible) humans, to prevent&#xA;problems. Humans can be a valuable line of defense for unknown unknowns, but&#xA;they cannot be the only line of defense for everything. While human-executed&#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/The_Checklist_Manifesto&#34;&gt;checklists are great&lt;/a&gt;,&#xA;they also have to be short and that makes them unsuitable for encoding a bunch&#xA;of knowledge about a problem domain. It can be tempting to add to the checklist&#xA;after every incident and never subtract from it, but this leads to inevitable&#xA;toil or skipped steps. Robots never get tired.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #90: How to estimate</title>
				<link>https://ckennelly.com/blog/how-to-estimate/</link>
				<pubDate>Thu, 06 Feb 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/how-to-estimate/</guid>
				<description>&lt;p&gt;Estimating savings can be useful for improving our decision making. In this&#xA;episode, we discuss how to make and use estimates in the&#xA;&lt;a href=&#34;https://ckennelly.com/blog/optimizing-optimization/&#34;&gt;optimization lifecycle&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;why-estimate&#34;&gt;Why estimate?&lt;/h2&gt;&#xA;&lt;p&gt;While looking for and developing optimizations, we use performance estimates&#xA;frequently to decide how to approach problems and spend time:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;A sense of how &lt;a href=&#34;https://ckennelly.com/blog/optimizing-optimization/&#34;&gt;large a problem domain&lt;/a&gt; is might tell us where to&#xA;look for opportunities in the first place.&lt;/li&gt;&#xA;&lt;li&gt;Given finite time and multiple projects to work on, we will prioritize those&#xA;with the highest return on investment. Estimation lets us fill in a guess&#xA;for &amp;ldquo;return,&amp;rdquo; before we have it in hand. Our goal is to make better&#xA;decisions, not perfect-in-hindsight ones.&lt;/li&gt;&#xA;&lt;li&gt;Within a specific optimization project, an estimate of the benefit might&#xA;inform us how much complexity (fiddly edge cases, technical debt, etc.) we&#xA;might be willing to tolerate.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The outcome of better estimates is better decisions, which informs us how much&#xA;precision we might need. If we&amp;rsquo;re considering project A that will make things 5%&#xA;faster and project B that will make things 0.1% faster, we don&amp;rsquo;t need to worry&#xA;about additional significant figures for project A&amp;rsquo;s estimate. A more precise&#xA;estimate for project A of 5.134% won&amp;rsquo;t change our prioritization all things&#xA;being equal (effort, complexity, etc.). In that situation, we should instead&#xA;prefer to focus on information that could &lt;a href=&#34;https://ckennelly.com/blog/decision-making-in-a-data-imperfect-world/&#34;&gt;change our decision&lt;/a&gt; rather&#xA;than gathering unneeded precision that won&amp;rsquo;t.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #88: Measurement methodology: Avoid the jelly beans trap</title>
				<link>https://ckennelly.com/blog/measurement-methodology-avoid-the-jelly-beans-trap/</link>
				<pubDate>Mon, 18 Nov 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/measurement-methodology-avoid-the-jelly-beans-trap/</guid>
				<description>&lt;p&gt;Measurement of performance optimizations often requires in-depth analysis due to&#xA;the inherent stochasticity of workloads. We need to gather data to calculate the&#xA;&lt;a href=&#34;https://ckennelly.com/blog/defining-and-measuring-optimization-success/&#34;&gt;metrics we&amp;rsquo;ve selected&lt;/a&gt;. In this episode, we discuss the importance&#xA;of defining your measurement methodology ahead of time rather than fishing for&#xA;possible sources of significance after the data has been collected.&lt;/p&gt;&#xA;&lt;h2 id=&#34;choose&#34;&gt;Choose a methodology, without peeking&lt;/h2&gt;&#xA;&lt;p&gt;Choose &lt;em&gt;and publish&lt;/em&gt; a methodology before looking at the data. Ideally, this&#xA;process is completed before any changes land. It is otherwise easy to pick the&#xA;methodology that tells the best story (the &amp;ldquo;biggest number&amp;rdquo;) unwittingly after&#xA;the fact. Preregistration of experiment methodology also helps avoid false&#xA;positives in statistical analysis.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #87: Two-way doors</title>
				<link>https://ckennelly.com/blog/two-way-doors/</link>
				<pubDate>Fri, 08 Nov 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/two-way-doors/</guid>
				<description>&lt;p&gt;Jeff Bezos &lt;a href=&#34;https://www.youtube.com/watch?v=rxsdOQa_QkM&#34;&gt;divides decisions&lt;/a&gt;&#xA;between &amp;ldquo;one-way doors&amp;rdquo;&amp;ndash;ones that are hard to reverse&amp;ndash;and &amp;ldquo;two-way&#xA;doors&amp;rdquo;&amp;ndash;those that are easy to reverse. Different optimizations fall on each&#xA;side of this divide. In this episode, we discuss patterns common to two-way&#xA;doors to reduce risk without exhaustively analyzing the situation. Good&#xA;decisions endure, while missteps can be corrected along the way.&lt;/p&gt;&#xA;&lt;h2 id=&#34;assessing-reversibility&#34;&gt;Assessing reversibility&lt;/h2&gt;&#xA;&lt;p&gt;As we explore a new optimization idea, we want to prioritize blockers to landing&#xA;and &lt;a href=&#34;https://ckennelly.com/blog/optimizing-optimization/&#34;&gt;ignore (for now) less important details&lt;/a&gt;. This is easier said&#xA;than done, since we need to figure out which subproblems are actually on our&#xA;critical path and those which can be ignored.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #83: Reducing memory indirections</title>
				<link>https://ckennelly.com/blog/reducing-memory-indirections/</link>
				<pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/reducing-memory-indirections/</guid>
				<description>&lt;p&gt;Memory indirections are a &lt;a href=&#34;https://ckennelly.com/blog/identifying-and-reducing-memory-bandwidth-needs/&#34;&gt;frequent cause&lt;/a&gt; for latency and memory&#xA;bandwidth bottlenecks. By forcing the processor to follow pointers to get to the&#xA;useful data it needs, our programs incur slowdowns and require more memory&#xA;bandwidth than they might need from a more efficient layout. In this episode, we&#xA;discuss tools for identifying inefficient data structures and improving them.&lt;/p&gt;&#xA;&lt;h2 id=&#34;latency-and-throughput&#34;&gt;Latency and throughput&lt;/h2&gt;&#xA;&lt;p&gt;In Google&amp;rsquo;s fleet, our processors spend&#xA;&lt;a href=&#34;https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/44271.pdf&#34;&gt;40-50% of their time&lt;/a&gt;&#xA;waiting for data coming from their caches or main memory. Memory access latency&#xA;and throughput are inextricably linked:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #79: Make at most one tradeoff at a time</title>
				<link>https://ckennelly.com/blog/make-at-most-one-tradeoff-at-a-time/</link>
				<pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/make-at-most-one-tradeoff-at-a-time/</guid>
				<description>&lt;p&gt;Developing and enabling optimizations can often involve tradeoffs: using more&#xA;RAM and less CPU, choosing which problems to solve right away and which to&#xA;defer, and so on. In this episode, we discuss examples and strategies for&#xA;breaking down projects into smaller steps to &lt;a href=&#34;https://ckennelly.com/blog/optimizing-optimization/&#34;&gt;increase velocity&lt;/a&gt; and&#xA;maximize area under the curve.&lt;/p&gt;&#xA;&lt;h2 id=&#34;step-by-step-migrations-swisstable&#34;&gt;Step-by-step migrations: SwissTable&lt;/h2&gt;&#xA;&lt;p&gt;Hash tables have many different implicit and explicit properties that affect&#xA;their contracts and behaviors. In designing&#xA;&lt;a href=&#34;https://abseil.io/about/design/swisstables&#34;&gt;SwissTables&lt;/a&gt; and planning for their&#xA;associated migrations, we made careful choices to defer, avoid, or consciously&#xA;embrace a great number of tradeoffs when modifying implementation contracts.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #74: Avoid sweeping street lights under rugs</title>
				<link>https://ckennelly.com/blog/avoid-sweeping-street-lights-under-rugs/</link>
				<pubDate>Fri, 10 Nov 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/avoid-sweeping-street-lights-under-rugs/</guid>
				<description>&lt;p&gt;While their issues go by multiple names (i.e.&#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/Streetlight_effect&#34;&gt;the streetlight effect&lt;/a&gt;,&#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/McNamara_fallacy&#34;&gt;the McNamara fallacy&lt;/a&gt;), proxy&#xA;metrics present a seductive danger. Simply put, people often focus on improving&#xA;the things they can measure and neglecting the things they cannot even if those&#xA;other things are important. In this episode, we explore multiple stories of how&#xA;this can go wrong to help ground ourselves in the real world failure modes that&#xA;&lt;a href=&#34;https://ckennelly.com/blog/defining-and-measuring-optimization-success/&#34;&gt;proxy metrics&lt;/a&gt; present.&lt;/p&gt;&#xA;&lt;p&gt;Most folks are familiar with the streetlight effect&amp;rsquo;s titular story:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #75: How to microbenchmark</title>
				<link>https://ckennelly.com/blog/how-to-microbenchmark/</link>
				<pubDate>Fri, 10 Nov 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/how-to-microbenchmark/</guid>
				<description>&lt;p&gt;Imagine having access to two Oracles. One gives 90% accurate predictions and&#xA;responds in 10 minutes and one that gives 99% accurate predictions and responds&#xA;in 1 month. With access to these secret seers, which will let us be best able to&#xA;make good decisions?&lt;/p&gt;&#xA;&lt;p&gt;&amp;ldquo;&lt;a href=&#34;https://ckennelly.com/blog/beware-microbenchmarks-bearing-gifts/&#34;&gt;Production is ultimately what matters&lt;/a&gt;&amp;rdquo; might obviate the need for&#xA;microbenchmarks altogether, but they are a useful tool in the performance&#xA;optimization toolbox. While reduced fidelity doesn&amp;rsquo;t sound desirable at face&#xA;value, it comes with an important tradeoff: speed.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #72: Optimizing optimization</title>
				<link>https://ckennelly.com/blog/optimizing-optimization/</link>
				<pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/optimizing-optimization/</guid>
				<description>&lt;p&gt;Finding optimizations is increasingly crucial as Moore&amp;rsquo;s Law ends and we can no&#xA;longer expect a free lunch from continued hardware innovation. In this episode,&#xA;we discuss the process of finding and developing optimizations to work on.&lt;/p&gt;&#xA;&lt;h2 id=&#34;planning&#34;&gt;Planning&lt;/h2&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&amp;ldquo;Plans are worthless, but planning is everything&amp;rdquo;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Just as efficiency projects are trying to maximize the productivity of our&#xA;hardware, the projects themselves can be optimized by effective planning.&#xA;Project selection makes a huge difference in outcomes and impact.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #70: Defining and measuring optimization success</title>
				<link>https://ckennelly.com/blog/defining-and-measuring-optimization-success/</link>
				<pubDate>Fri, 20 Oct 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/defining-and-measuring-optimization-success/</guid>
				<description>&lt;p&gt;Engineers optimizing performance are ultimately trying to maximize the things&#xA;Google does (serve search queries, videos on YouTube, etc.) and minimize the&#xA;things Google buys (CPUs, RAM, disks, etc.). In this episode, we&#xA;discuss how to choose metrics that help us influence the optimizations we work&#xA;on, make effective decisions, and measure the outcome of projects.&lt;/p&gt;&#xA;&lt;h2 id=&#34;economic-value&#34;&gt;Economic value&lt;/h2&gt;&#xA;&lt;p&gt;Things like search queries and video playbacks on YouTube represent economic&#xA;value. Useful work is happening to deliver an experience to an end-user which&#xA;then translates into Google revenue.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #64: More Moore with better API design</title>
				<link>https://ckennelly.com/blog/more-moore-with-better-api-design/</link>
				<pubDate>Tue, 10 Oct 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/more-moore-with-better-api-design/</guid>
				<description>&lt;p&gt;Optimizing library implementations only carries us so far in making software&#xA;more efficient. In this episode, we discuss the importance of good APIs and the&#xA;right abstractions for finding optimization opportunities. As we can make the&#xA;hardware&amp;ndash;especially with the end of Moore&amp;rsquo;s Law&amp;ndash;and software run only so fast,&#xA;the right abstractions give us continued optimization opportunities.&lt;/p&gt;&#xA;&lt;h2 id=&#34;correctness-is-paramount&#34;&gt;Correctness is paramount&lt;/h2&gt;&#xA;&lt;p&gt;We can simplify an implementation down to &lt;code&gt;return 42;&lt;/code&gt; regardless of the input&#xA;to see blazing fast results, but an API that doesn&amp;rsquo;t work correctly isn&amp;rsquo;t doing&#xA;its job.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #62: Identifying and reducing memory bandwidth needs</title>
				<link>https://ckennelly.com/blog/identifying-and-reducing-memory-bandwidth-needs/</link>
				<pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/identifying-and-reducing-memory-bandwidth-needs/</guid>
				<description>&lt;p&gt;To accomplish useful work with processors, programs need to access main memory.&#xA;The rate that programs can transfer data to/from main memory has not grown as&#xA;fast as processors getting greater per-core performance and more cores. The&#xA;Memory Wall, &lt;a href=&#34;https://dl.acm.org/doi/10.1145/216585.216588&#34;&gt;long predicted&lt;/a&gt;, is&#xA;here. Memory bandwidth is increasingly the bottleneck for how much useful work&#xA;modern data centers can accomplish with its CPUs. Optimizing for memory&#xA;bandwidth productivity can make code faster&amp;ndash;by reducing memory stalls&amp;ndash;and RAM&#xA;footprints smaller. In this episode, we discuss techniques for identifying&#xA;hotspots and reducing their impact.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #60: In-process profiling: lessons learned</title>
				<link>https://ckennelly.com/blog/in-process-profiling-lessons-learned/</link>
				<pubDate>Sun, 15 Oct 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/in-process-profiling-lessons-learned/</guid>
				<description>&lt;p&gt;&lt;a href=&#34;https://research.google/pubs/pub36575/&#34;&gt;Google-Wide Profiling&lt;/a&gt; collects data&#xA;not just from our hardware performance counters, but also from in-process&#xA;profilers. These have been covered in previous episodes covering&#xA;&lt;a href=&#34;https://ckennelly.com/blog/fixing-things-with-hashtable-profiling/&#34;&gt;hashtables&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In-process profilers can give deeper insights about the state of the program&#xA;that are hard to observe from the outside, such as lock contention, where memory&#xA;was allocated, and the distribution of collisions on a hashtable. In this tip we&#xA;discuss how to determine that a new profiler is necessary, and the best&#xA;practices for producing one.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #39: Beware microbenchmarks bearing gifts</title>
				<link>https://ckennelly.com/blog/beware-microbenchmarks-bearing-gifts/</link>
				<pubDate>Thu, 02 Mar 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/beware-microbenchmarks-bearing-gifts/</guid>
				<description>&lt;p&gt;Benchmarks are only a tool for debugging efficiency: Production is ultimately&#xA;what matters. Benchmarks analyze the performance of code under the specific&#xA;circumstances created and maintained by the benchmark. They cannot perfectly&#xA;predict the performance of code in the real world. In this episode, we discuss&#xA;some of the pitfalls of microbenchmarks and mitigation strategies.&lt;/p&gt;&#xA;&lt;p&gt;For example, we can use the following series of benchmarks for evaluating&#xA;changes to search query performance:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #26: Fixing things with hashtable profiling</title>
				<link>https://ckennelly.com/blog/fixing-things-with-hashtable-profiling/</link>
				<pubDate>Wed, 16 Jul 2025 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/fixing-things-with-hashtable-profiling/</guid>
				<description>&lt;p&gt;As discussed by Matt Kulukundis in his&#xA;&lt;a href=&#34;https://www.youtube.com/watch?v=JZE3_0qvrMg&#34;&gt;2019 CppCon talk&lt;/a&gt;, identifying a&#xA;&amp;ldquo;slow&amp;rdquo; hashtable from a pure CPU profile can be challenging. Abseil&amp;rsquo;s&#xA;&lt;a href=&#34;https://abseil.io/tips/136&#34;&gt;C++ hashtables&lt;/a&gt; have a built-in profiler. In this episode we&#xA;describe what insights about the hash function quality and hash collisions it&#xA;can provide, making them discernible at scale. We also look at a couple of case&#xA;studies where this information was used to improve Google&amp;rsquo;s production fleet&#xA;efficiency.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Performance Tip of the Week #9: Optimizations past their prime</title>
				<link>https://ckennelly.com/blog/optimizations-past-their-prime/</link>
				<pubDate>Thu, 02 Mar 2023 00:00:00 +0000</pubDate>
				<guid>https://ckennelly.com/blog/optimizations-past-their-prime/</guid>
				<description>&lt;h2 id=&#34;overview&#34;&gt;Overview&lt;/h2&gt;&#xA;&lt;p&gt;Optimizations don&amp;rsquo;t always age gracefully. Faster yesterday might mean slower&#xA;today.&lt;/p&gt;&#xA;&lt;p&gt;Benchmarks citing performance on Intel Pentium 3&amp;rsquo;s or AMD Opterons may have been&#xA;meaningful several years ago, but optimization equilibria, originally chosen for&#xA;long-unplugged platforms, may have changed since. Let&amp;rsquo;s look at a couple&#xA;examples where well-intended optimizations ultimately hurt performance in the&#xA;long run.&lt;/p&gt;&#xA;&lt;h2 id=&#34;popcount&#34;&gt;Popcount&lt;/h2&gt;&#xA;&lt;p&gt;In 2008, Intel introduced the &lt;code&gt;popcnt&lt;/code&gt; instruction to determine the number of&#xA;set bits in a 32- or 64-bit integer. This is of interest for computing hamming&#xA;distances and a bunch of other things. Without the instruction, we can use a&#xA;slightly&#xA;&lt;a href=&#34;https://en.wikipedia.org/wiki/Hamming_weight#Efficient_implementation&#34;&gt;more complex, longer sequence&lt;/a&gt;&#xA;of shifts, bitwise ands, and adds to achieve the same.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
