<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Condecoding Blog</title>
    <subtitle>A personal notebook about engineering, experiments, and things worth understanding.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://blog.condecoding.com/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://blog.condecoding.com"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-11-23T00:00:00+00:00</updated>
    <id>https://blog.condecoding.com/atom.xml</id>
    <entry xml:lang="en">
        <title>Verus&#39;s Secret Weapon: Trusting Rust&#39;s Own Borrow Checker</title>
        <published>2026-11-23T00:00:00+00:00</published>
        <updated>2026-11-23T00:00:00+00:00</updated>
        
        <author>
          <name>Rafael</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.condecoding.com/posts/verus-secret-weapon/"/>
        <id>https://blog.condecoding.com/posts/verus-secret-weapon/</id>
        
        <content type="html" xml:base="https://blog.condecoding.com/posts/verus-secret-weapon/">&lt;p&gt;Why is Verus making formal verification practical for real Rust systems when older tools struggled?&lt;/p&gt;
&lt;p&gt;One architectural insight: Verus refuses to rebuild separation logic from scratch.&lt;/p&gt;
&lt;p&gt;Because safe Rust already enforces aliasing-XOR-mutability, Verus trusts rustc&#39;s borrow checker. Immutable references (&amp;amp;T) and owned pointers (Box, Rc, Arc) are encoded directly as mathematical values of type T in the SMT solver, rather than modeling raw heap locations and framing rules manually.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/posts/verus-secret-weapon/verus-secret-weapon.png&quot; alt=&quot;Architecture comparison diagram contrasting a traditional verifier (Code to Custom Separation Logic Engine to SMT) with Verus (Code to Rust Borrow Checker handling aliasing to Direct SMT Value Encoding)&quot; /&gt;&lt;/p&gt;
&lt;p&gt;You write specs, proofs, and executable code in pure Rust syntax inside verus! { ... } blocks, and the compiler verifies the math while the borrow checker handles aliasing.&lt;/p&gt;
&lt;p&gt;Less proof boilerplate. Same mathematical rigor.&lt;/p&gt;
&lt;p&gt;Which goes to show that the borrow checker offers more than meets the eye, its rules, despite being stricter than they have to be, offer better ergonomics and safety guarantees.
Sounds a lot like the performance offered by the aligned MOVes in the x86 CPU architecture that all has acquire/release semantics, stricter than it has to be, but offers a robust and performant architecture.&lt;/p&gt;
&lt;p&gt;Have you tried writing specs inside a systems language instead of an external proof assistant like Coq or Dafny?&lt;/p&gt;
&lt;p&gt;#RustLang #Verus #FormalMethods #Compilers&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Why the Borrow Checker Isn&#39;t Enough</title>
        <published>2026-11-22T00:00:00+00:00</published>
        <updated>2026-11-22T00:00:00+00:00</updated>
        
        <author>
          <name>Rafael</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.condecoding.com/posts/why-the-borrow-checker-isnt-enough/"/>
        <id>https://blog.condecoding.com/posts/why-the-borrow-checker-isnt-enough/</id>
        
        <content type="html" xml:base="https://blog.condecoding.com/posts/why-the-borrow-checker-isnt-enough/">&lt;p&gt;Most developers treat Rust&#39;s borrow checker as the finish line. For critical systems, it&#39;s only the starting line.&lt;/p&gt;
&lt;p&gt;Safe Rust guarantees memory safety and data-race freedom at compile time. What it &lt;em&gt;cannot&lt;/em&gt; guarantee is functional correctness:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Does your custom allocator never hand out overlapping memory regions?&lt;/li&gt;
&lt;li&gt;Does your binary parser satisfy round-trip consistency?&lt;/li&gt;
&lt;li&gt;Does your distributed controller always converge to a desired state?&lt;/li&gt;
&lt;/ul&gt;
&lt;section class=&quot;widget-shell&quot; data-widget=&quot;quiz&quot; data-props=&quot;{&amp;quot;locale&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;messages&amp;quot;:{&amp;quot;add_stage&amp;quot;:&amp;quot;Add stage&amp;quot;,&amp;quot;all_articles&amp;quot;:&amp;quot;All articles&amp;quot;,&amp;quot;all_tags&amp;quot;:&amp;quot;All tags&amp;quot;,&amp;quot;back_home&amp;quot;:&amp;quot;Back to the notebook&amp;quot;,&amp;quot;breakdown&amp;quot;:&amp;quot;Latency by stage&amp;quot;,&amp;quot;by_author&amp;quot;:&amp;quot;By&amp;quot;,&amp;quot;chart_label&amp;quot;:&amp;quot;Proportional latency chart. The table below contains the same values.&amp;quot;,&amp;quot;development&amp;quot;:&amp;quot;Development preview&amp;quot;,&amp;quot;duration&amp;quot;:&amp;quot;Duration (ms)&amp;quot;,&amp;quot;explore_articles&amp;quot;:&amp;quot;Explore the articles&amp;quot;,&amp;quot;eyebrow&amp;quot;:&amp;quot;A personal notebook&amp;quot;,&amp;quot;featured_description&amp;quot;:&amp;quot;A request is a collection of small waits. Change the numbers and see the whole picture.&amp;quot;,&amp;quot;featured_label&amp;quot;:&amp;quot;The interactive lab&amp;quot;,&amp;quot;featured_title&amp;quot;:&amp;quot;Where does the time go?&amp;quot;,&amp;quot;feed&amp;quot;:&amp;quot;Atom feed&amp;quot;,&amp;quot;filter_tag&amp;quot;:&amp;quot;Filter by tag&amp;quot;,&amp;quot;footer_note&amp;quot;:&amp;quot;Written with curiosity. Built with Rust.&amp;quot;,&amp;quot;hero_description&amp;quot;:&amp;quot;Notes on engineering, experiments, and the things worth understanding. Sometimes the best explanation is one you can play with.&amp;quot;,&amp;quot;hero_title&amp;quot;:&amp;quot;Ideas, made tangible.&amp;quot;,&amp;quot;illustrative&amp;quot;:&amp;quot;Illustrative example · sequential stages&amp;quot;,&amp;quot;interactive&amp;quot;:&amp;quot;Interactive&amp;quot;,&amp;quot;invalid_duration&amp;quot;:&amp;quot;Give every stage a name and a finite, nonnegative duration. The total must fit within a finite number.&amp;quot;,&amp;quot;language&amp;quot;:&amp;quot;Language&amp;quot;,&amp;quot;latency_title&amp;quot;:&amp;quot;Build a latency budget&amp;quot;,&amp;quot;latest&amp;quot;:&amp;quot;Latest notes&amp;quot;,&amp;quot;nav_about&amp;quot;:&amp;quot;About&amp;quot;,&amp;quot;nav_articles&amp;quot;:&amp;quot;Articles&amp;quot;,&amp;quot;nav_main&amp;quot;:&amp;quot;Main navigation&amp;quot;,&amp;quot;nav_search&amp;quot;:&amp;quot;Search&amp;quot;,&amp;quot;no_results&amp;quot;:&amp;quot;No articles match. Try another word or tag.&amp;quot;,&amp;quot;not_found&amp;quot;:&amp;quot;This page wandered off.&amp;quot;,&amp;quot;not_found_description&amp;quot;:&amp;quot;The address may have changed. There are more ideas to explore back at the beginning.&amp;quot;,&amp;quot;quiz_again&amp;quot;:&amp;quot;Try again&amp;quot;,&amp;quot;quiz_answered&amp;quot;:&amp;quot;{answered} of {total} answered&amp;quot;,&amp;quot;quiz_can&amp;quot;:&amp;quot;Can verify&amp;quot;,&amp;quot;quiz_cannot&amp;quot;:&amp;quot;Cannot verify&amp;quot;,&amp;quot;quiz_check&amp;quot;:&amp;quot;Check answers&amp;quot;,&amp;quot;quiz_intro&amp;quot;:&amp;quot;For each property, choose whether the borrow checker can verify it in safe Rust. Then check your answers.&amp;quot;,&amp;quot;quiz_right&amp;quot;:&amp;quot;Right&amp;quot;,&amp;quot;quiz_score&amp;quot;:&amp;quot;Score: {score} of {total}&amp;quot;,&amp;quot;quiz_show_answers&amp;quot;:&amp;quot;Show the answers&amp;quot;,&amp;quot;quiz_truth_cannot&amp;quot;:&amp;quot;The borrow checker cannot verify this.&amp;quot;,&amp;quot;quiz_truth_verifiable&amp;quot;:&amp;quot;The borrow checker can verify this.&amp;quot;,&amp;quot;quiz_wrong&amp;quot;:&amp;quot;Not quite&amp;quot;,&amp;quot;read_article&amp;quot;:&amp;quot;Read article&amp;quot;,&amp;quot;remove_stage&amp;quot;:&amp;quot;Remove&amp;quot;,&amp;quot;reset&amp;quot;:&amp;quot;Reset example&amp;quot;,&amp;quot;results&amp;quot;:&amp;quot;Articles found&amp;quot;,&amp;quot;search_description&amp;quot;:&amp;quot;Search the articles in this language, or narrow them down by tag.&amp;quot;,&amp;quot;search_fallback&amp;quot;:&amp;quot;You can also browse every article and tag below.&amp;quot;,&amp;quot;search_label&amp;quot;:&amp;quot;Search articles&amp;quot;,&amp;quot;search_placeholder&amp;quot;:&amp;quot;A word, an idea, a question…&amp;quot;,&amp;quot;search_title&amp;quot;:&amp;quot;Find a thread to follow.&amp;quot;,&amp;quot;sequential_note&amp;quot;:&amp;quot;These stages happen one after another. This example adds their durations; parallel work needs a different model.&amp;quot;,&amp;quot;share&amp;quot;:&amp;quot;Share&amp;quot;,&amp;quot;skip_content&amp;quot;:&amp;quot;Skip to content&amp;quot;,&amp;quot;stage&amp;quot;:&amp;quot;Stage&amp;quot;,&amp;quot;stage_label&amp;quot;:&amp;quot;Stage name&amp;quot;,&amp;quot;start_search&amp;quot;:&amp;quot;Open interactive search&amp;quot;,&amp;quot;tagged&amp;quot;:&amp;quot;Articles tagged&amp;quot;,&amp;quot;tags&amp;quot;:&amp;quot;Tags&amp;quot;,&amp;quot;total&amp;quot;:&amp;quot;Total latency&amp;quot;,&amp;quot;translations&amp;quot;:&amp;quot;Read this article in&amp;quot;,&amp;quot;try_experiment&amp;quot;:&amp;quot;Try an experiment&amp;quot;,&amp;quot;widget_fallback&amp;quot;:&amp;quot;Example values&amp;quot;,&amp;quot;widget_retry&amp;quot;:&amp;quot;Retry interactive version&amp;quot;,&amp;quot;widget_unavailable&amp;quot;:&amp;quot;The interactive version could not load. The example below remains available.&amp;quot;},&amp;quot;options&amp;quot;:[{&amp;quot;explanation&amp;quot;:&amp;quot;Safe Rust rejects a reference that outlives the value it points to, so a freed value cannot be reached through a reference.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;no-use-after-free&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;No use-after-free&amp;quot;,&amp;quot;verifiable&amp;quot;:true},{&amp;quot;explanation&amp;quot;:&amp;quot;Safe Rust rejects conflicting access to the same data from several places at once. Send and Sync decide what may cross threads.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;no-data-races&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;No data races&amp;quot;,&amp;quot;verifiable&amp;quot;:true},{&amp;quot;explanation&amp;quot;:&amp;quot;Across safe code, the compiler&amp;#39;s ownership and borrowing rules cover memory safety as a whole. The guarantee stops at unsafe blocks, which you must check yourself.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;memory-safety&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;Memory safety&amp;quot;,&amp;quot;verifiable&amp;quot;:true},{&amp;quot;explanation&amp;quot;:&amp;quot;The checker reasons about the references in your code. Whether an allocator&amp;#39;s internal bookkeeping hands out disjoint regions is a property of its logic, so it needs tests or a proof.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;allocator-regions&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;Allocator regions don&amp;#39;t overlap&amp;quot;,&amp;quot;verifiable&amp;quot;:false},{&amp;quot;explanation&amp;quot;:&amp;quot;Parsing a value and serializing it back to the same bytes is a functional property. Types cannot express it, so it needs a test or a proof.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;parser-round-trips&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;Parser round-trips&amp;quot;,&amp;quot;verifiable&amp;quot;:false},{&amp;quot;explanation&amp;quot;:&amp;quot;Liveness is about what eventually happens over time in a distributed system. Borrow checking looks at one program&amp;#39;s references, not at how a system behaves over time.&amp;quot;,&amp;quot;id&amp;quot;:&amp;quot;controller-liveness&amp;quot;,&amp;quot;label&amp;quot;:&amp;quot;Controller liveness&amp;quot;,&amp;quot;verifiable&amp;quot;:false}],&amp;quot;question&amp;quot;:&amp;quot;Which of these can the borrow checker verify?&amp;quot;}&quot; data-error-message=&quot;The interactive version could not load. The example below remains available.&quot;&gt;
  &lt;div data-widget-mount&gt;&lt;/div&gt;
  &lt;div data-widget-fallback&gt;&lt;h3&gt;Which of these can the borrow checker verify?&lt;/h3&gt;&lt;details&gt;&lt;summary&gt;Show the answers&lt;/summary&gt;&lt;ol&gt;&lt;li&gt;&lt;strong&gt;No use-after-free&lt;/strong&gt;: The borrow checker can verify this. Safe Rust rejects a reference that outlives the value it points to, so a freed value cannot be reached through a reference.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;No data races&lt;/strong&gt;: The borrow checker can verify this. Safe Rust rejects conflicting access to the same data from several places at once. Send and Sync decide what may cross threads.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Memory safety&lt;/strong&gt;: The borrow checker can verify this. Across safe code, the compiler&amp;#39;s ownership and borrowing rules cover memory safety as a whole. The guarantee stops at unsafe blocks, which you must check yourself.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Allocator regions don&amp;#39;t overlap&lt;/strong&gt;: The borrow checker cannot verify this. The checker reasons about the references in your code. Whether an allocator&amp;#39;s internal bookkeeping hands out disjoint regions is a property of its logic, so it needs tests or a proof.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Parser round-trips&lt;/strong&gt;: The borrow checker cannot verify this. Parsing a value and serializing it back to the same bytes is a functional property. Types cannot express it, so it needs a test or a proof.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Controller liveness&lt;/strong&gt;: The borrow checker cannot verify this. Liveness is about what eventually happens over time in a distributed system. Borrow checking looks at one program&amp;#39;s references, not at how a system behaves over time.&lt;/li&gt;&lt;/ol&gt;&lt;/details&gt;&lt;/div&gt;
  &lt;p class=&quot;widget-error&quot; data-widget-error role=&quot;status&quot; hidden&gt;&lt;/p&gt;
  &lt;button type=&quot;button&quot; class=&quot;button-subtle&quot; data-widget-retry hidden&gt;Retry interactive version&lt;/button&gt;
&lt;/section&gt;
&lt;p&gt;Formal verification closes that gap statically—checking executable Rust against mathematical specifications across &lt;em&gt;all&lt;/em&gt; possible inputs, with zero runtime overhead.&lt;/p&gt;
&lt;p&gt;If you want to push beyond &quot;it compiles cleanly,&quot; tools like Verus and Kani are where the next decade of systems engineering is happening.&lt;/p&gt;
&lt;p&gt;Where in your stack would mathematical proof of correctness actually pay for itself?&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Where does the time go? A latency budget you can touch</title>
        <published>2026-10-26T00:00:00+00:00</published>
        <updated>2026-10-26T00:00:00+00:00</updated>
        
        <author>
          <name>Rafael</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://blog.condecoding.com/posts/latency-budget/"/>
        <id>https://blog.condecoding.com/posts/latency-budget/</id>
        
        <content type="html" xml:base="https://blog.condecoding.com/posts/latency-budget/">&lt;p&gt;A request finishes in 100 milliseconds. That number tells us how long we waited. It does not tell us where the time went.&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;latency budget&lt;/strong&gt; divides that wait into stages. In the simple model below, the request spends 20 ms reaching a service, 30 ms doing work, and 50 ms waiting for storage. Every value is illustrative: this is a model to explore, not a measurement of a running system.&lt;/p&gt;
&lt;h2 id=&quot;change-one-thing&quot;&gt;Change one thing&lt;/h2&gt;
&lt;p&gt;Increase the storage duration. Then make the computation twice as fast. The chart shows how each change affects the total.&lt;/p&gt;
&lt;section class=&quot;widget-shell&quot; data-widget=&quot;latency&quot; data-props=&quot;{&amp;quot;locale&amp;quot;:&amp;quot;en&amp;quot;,&amp;quot;messages&amp;quot;:{&amp;quot;add_stage&amp;quot;:&amp;quot;Add stage&amp;quot;,&amp;quot;all_articles&amp;quot;:&amp;quot;All articles&amp;quot;,&amp;quot;all_tags&amp;quot;:&amp;quot;All tags&amp;quot;,&amp;quot;back_home&amp;quot;:&amp;quot;Back to the notebook&amp;quot;,&amp;quot;breakdown&amp;quot;:&amp;quot;Latency by stage&amp;quot;,&amp;quot;by_author&amp;quot;:&amp;quot;By&amp;quot;,&amp;quot;chart_label&amp;quot;:&amp;quot;Proportional latency chart. The table below contains the same values.&amp;quot;,&amp;quot;development&amp;quot;:&amp;quot;Development preview&amp;quot;,&amp;quot;duration&amp;quot;:&amp;quot;Duration (ms)&amp;quot;,&amp;quot;explore_articles&amp;quot;:&amp;quot;Explore the articles&amp;quot;,&amp;quot;eyebrow&amp;quot;:&amp;quot;A personal notebook&amp;quot;,&amp;quot;featured_description&amp;quot;:&amp;quot;A request is a collection of small waits. Change the numbers and see the whole picture.&amp;quot;,&amp;quot;featured_label&amp;quot;:&amp;quot;The interactive lab&amp;quot;,&amp;quot;featured_title&amp;quot;:&amp;quot;Where does the time go?&amp;quot;,&amp;quot;feed&amp;quot;:&amp;quot;Atom feed&amp;quot;,&amp;quot;filter_tag&amp;quot;:&amp;quot;Filter by tag&amp;quot;,&amp;quot;footer_note&amp;quot;:&amp;quot;Written with curiosity. Built with Rust.&amp;quot;,&amp;quot;hero_description&amp;quot;:&amp;quot;Notes on engineering, experiments, and the things worth understanding. Sometimes the best explanation is one you can play with.&amp;quot;,&amp;quot;hero_title&amp;quot;:&amp;quot;Ideas, made tangible.&amp;quot;,&amp;quot;illustrative&amp;quot;:&amp;quot;Illustrative example · sequential stages&amp;quot;,&amp;quot;interactive&amp;quot;:&amp;quot;Interactive&amp;quot;,&amp;quot;invalid_duration&amp;quot;:&amp;quot;Give every stage a name and a finite, nonnegative duration. The total must fit within a finite number.&amp;quot;,&amp;quot;language&amp;quot;:&amp;quot;Language&amp;quot;,&amp;quot;latency_title&amp;quot;:&amp;quot;Build a latency budget&amp;quot;,&amp;quot;latest&amp;quot;:&amp;quot;Latest notes&amp;quot;,&amp;quot;nav_about&amp;quot;:&amp;quot;About&amp;quot;,&amp;quot;nav_articles&amp;quot;:&amp;quot;Articles&amp;quot;,&amp;quot;nav_main&amp;quot;:&amp;quot;Main navigation&amp;quot;,&amp;quot;nav_search&amp;quot;:&amp;quot;Search&amp;quot;,&amp;quot;no_results&amp;quot;:&amp;quot;No articles match. Try another word or tag.&amp;quot;,&amp;quot;not_found&amp;quot;:&amp;quot;This page wandered off.&amp;quot;,&amp;quot;not_found_description&amp;quot;:&amp;quot;The address may have changed. There are more ideas to explore back at the beginning.&amp;quot;,&amp;quot;quiz_again&amp;quot;:&amp;quot;Try again&amp;quot;,&amp;quot;quiz_answered&amp;quot;:&amp;quot;{answered} of {total} answered&amp;quot;,&amp;quot;quiz_can&amp;quot;:&amp;quot;Can verify&amp;quot;,&amp;quot;quiz_cannot&amp;quot;:&amp;quot;Cannot verify&amp;quot;,&amp;quot;quiz_check&amp;quot;:&amp;quot;Check answers&amp;quot;,&amp;quot;quiz_intro&amp;quot;:&amp;quot;For each property, choose whether the borrow checker can verify it in safe Rust. Then check your answers.&amp;quot;,&amp;quot;quiz_right&amp;quot;:&amp;quot;Right&amp;quot;,&amp;quot;quiz_score&amp;quot;:&amp;quot;Score: {score} of {total}&amp;quot;,&amp;quot;quiz_show_answers&amp;quot;:&amp;quot;Show the answers&amp;quot;,&amp;quot;quiz_truth_cannot&amp;quot;:&amp;quot;The borrow checker cannot verify this.&amp;quot;,&amp;quot;quiz_truth_verifiable&amp;quot;:&amp;quot;The borrow checker can verify this.&amp;quot;,&amp;quot;quiz_wrong&amp;quot;:&amp;quot;Not quite&amp;quot;,&amp;quot;read_article&amp;quot;:&amp;quot;Read article&amp;quot;,&amp;quot;remove_stage&amp;quot;:&amp;quot;Remove&amp;quot;,&amp;quot;reset&amp;quot;:&amp;quot;Reset example&amp;quot;,&amp;quot;results&amp;quot;:&amp;quot;Articles found&amp;quot;,&amp;quot;search_description&amp;quot;:&amp;quot;Search the articles in this language, or narrow them down by tag.&amp;quot;,&amp;quot;search_fallback&amp;quot;:&amp;quot;You can also browse every article and tag below.&amp;quot;,&amp;quot;search_label&amp;quot;:&amp;quot;Search articles&amp;quot;,&amp;quot;search_placeholder&amp;quot;:&amp;quot;A word, an idea, a question…&amp;quot;,&amp;quot;search_title&amp;quot;:&amp;quot;Find a thread to follow.&amp;quot;,&amp;quot;sequential_note&amp;quot;:&amp;quot;These stages happen one after another. This example adds their durations; parallel work needs a different model.&amp;quot;,&amp;quot;share&amp;quot;:&amp;quot;Share&amp;quot;,&amp;quot;skip_content&amp;quot;:&amp;quot;Skip to content&amp;quot;,&amp;quot;stage&amp;quot;:&amp;quot;Stage&amp;quot;,&amp;quot;stage_label&amp;quot;:&amp;quot;Stage name&amp;quot;,&amp;quot;start_search&amp;quot;:&amp;quot;Open interactive search&amp;quot;,&amp;quot;tagged&amp;quot;:&amp;quot;Articles tagged&amp;quot;,&amp;quot;tags&amp;quot;:&amp;quot;Tags&amp;quot;,&amp;quot;total&amp;quot;:&amp;quot;Total latency&amp;quot;,&amp;quot;translations&amp;quot;:&amp;quot;Read this article in&amp;quot;,&amp;quot;try_experiment&amp;quot;:&amp;quot;Try an experiment&amp;quot;,&amp;quot;widget_fallback&amp;quot;:&amp;quot;Example values&amp;quot;,&amp;quot;widget_retry&amp;quot;:&amp;quot;Retry interactive version&amp;quot;,&amp;quot;widget_unavailable&amp;quot;:&amp;quot;The interactive version could not load. The example below remains available.&amp;quot;},&amp;quot;stages&amp;quot;:[{&amp;quot;duration_ms&amp;quot;:20.0,&amp;quot;label&amp;quot;:&amp;quot;Network&amp;quot;},{&amp;quot;duration_ms&amp;quot;:30.0,&amp;quot;label&amp;quot;:&amp;quot;Compute&amp;quot;},{&amp;quot;duration_ms&amp;quot;:50.0,&amp;quot;label&amp;quot;:&amp;quot;Storage&amp;quot;}]}&quot; data-error-message=&quot;The interactive version could not load. The example below remains available.&quot;&gt;
  &lt;div data-widget-mount&gt;&lt;/div&gt;
  &lt;div data-widget-fallback&gt;&lt;h3&gt;Example values&lt;/h3&gt;&lt;p&gt;Illustrative example · sequential stages&lt;/p&gt;&lt;p class=&quot;total&quot;&gt;Total latency &lt;strong&gt;100 ms&lt;/strong&gt;&lt;/p&gt;&lt;table&gt;&lt;caption&gt;Latency by stage&lt;/caption&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Stage&lt;/th&gt;&lt;th&gt;Duration (ms)&lt;/th&gt;&lt;th&gt;Share&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th scope=&quot;row&quot;&gt;Network&lt;/th&gt;&lt;td&gt;20 ms&lt;/td&gt;&lt;td&gt;20%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th scope=&quot;row&quot;&gt;Compute&lt;/th&gt;&lt;td&gt;30 ms&lt;/td&gt;&lt;td&gt;30%&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;th scope=&quot;row&quot;&gt;Storage&lt;/th&gt;&lt;td&gt;50 ms&lt;/td&gt;&lt;td&gt;50%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;
  &lt;p class=&quot;widget-error&quot; data-widget-error role=&quot;status&quot; hidden&gt;&lt;/p&gt;
  &lt;button type=&quot;button&quot; class=&quot;button-subtle&quot; data-widget-retry hidden&gt;Retry interactive version&lt;/button&gt;
&lt;/section&gt;
&lt;p&gt;The largest section of the chart is a useful place to investigate. Saving 10 ms has the same effect on the total wherever it happens, but a large stage may offer more room for improvement.&lt;/p&gt;
&lt;h2 id=&quot;be-explicit-about-the-model&quot;&gt;Be explicit about the model&lt;/h2&gt;
&lt;p&gt;This calculator adds stages that happen &lt;strong&gt;one after another&lt;/strong&gt;:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #24292E; background-color: #FFFFFF;&quot; &gt;&lt;code data-lang=&quot;rust&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;let&lt;/span&gt;&lt;span&gt; total_ms&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt; =&lt;/span&gt;&lt;span&gt; stages&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #6F42C1;&quot;&gt;iter&lt;/span&gt;&lt;span&gt;()&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #6F42C1;&quot;&gt;map&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;|&lt;/span&gt;&lt;span&gt;stage&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;|&lt;/span&gt;&lt;span&gt; stage&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;.&lt;/span&gt;&lt;span&gt;duration_ms)&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #6F42C1;&quot;&gt;sum&lt;/span&gt;&lt;span style=&quot;color: #D73A49;&quot;&gt;::&lt;/span&gt;&lt;span&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #6F42C1;&quot;&gt;f64&lt;/span&gt;&lt;span&gt;&amp;gt;();&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Parallel work behaves differently. If two independent operations take 30 ms and 50 ms and start together, waiting for both takes approximately 50 ms, plus coordination overhead. Adding them would describe a different execution order.&lt;/p&gt;
&lt;p&gt;Queues, retries, cache hits and network variation also need their own assumptions. A useful model makes those assumptions visible before presenting a precise-looking number.&lt;/p&gt;
&lt;h2 id=&quot;take-the-question-back-to-the-system&quot;&gt;Take the question back to the system&lt;/h2&gt;
&lt;p&gt;Start by measuring the stages of a real request. Preserve the distinction between the observed timings and the scenario you are testing. Then use a small model to ask what a change might achieve—and measure again after implementing it.&lt;/p&gt;
</content>
        
    </entry>
</feed>
