{"id":2932,"date":"2024-08-24T12:55:25","date_gmt":"2024-08-24T11:55:25","guid":{"rendered":"https:\/\/contentlabstudy.com\/soft\/?p=2932"},"modified":"2026-09-24T21:15:51","modified_gmt":"2026-09-24T20:15:51","slug":"software-performance-issues","status":"publish","type":"post","link":"https:\/\/contentlabstudy.com\/soft\/software-performance-issues\/","title":{"rendered":"Software Performance Issues"},"content":{"rendered":"<p>A <strong>performance issue<\/strong> is a missed latency, throughput, or cost budget \u2014 not \u201cthe server feels slow.\u201d Start from a number (p95 checkout, jobs\/hour, $ of DB CPU). Then measure, change one thing, measure again.<\/p>\n<h2>Find the dominant cost<\/h2>\n<ul>\n<li><strong>Wait vs work:<\/strong> is the thread on-CPU or blocked on I\/O? Profilers and <code>EXPLAIN ANALYZE<\/code> disagree with guesses.<\/li>\n<li><strong>N+1 and chatty I\/O:<\/strong> 80 HTTP calls in a page render. Batch, join, or cache with a defined TTL and invalidation.<\/li>\n<li><strong>Locking:<\/strong> serializing on one row or one global mutex. See <a href=\"\/soft\/sql-for-business-logic\/\">SQL<\/a>.<\/li>\n<li><strong>Payload size:<\/strong> 5 MB JSON for a list view. Paginate; don\u2019t serialize the universe.<\/li>\n<li><strong>GC \/ allocations:<\/strong> hot paths that allocate per request in a managed runtime.<\/li>\n<\/ul>\n<h2>Cache is a correctness problem<\/h2>\n<p>Cache only with a story for stale reads. Key design, TTL, and stampede (dogpile) matter. Caching a wrong authorization decision is a security bug. See <a href=\"\/soft\/reliability-design-patterns\/\">reliability<\/a> for timeouts so a slow cache is not an infinite wait.<\/p>\n<h2>Capacity vs algorithm<\/h2>\n<p>Sometimes you buy a larger instance. Sometimes you stop doing O(n\u00b2) on a 100k list. Do not scale out a quadratic algorithm and call it architecture.<\/p>\n<h2>Example<\/h2>\n<p><code>EXPLAIN ANALYZE<\/code> shows a sequential scan of hundreds of milliseconds. The predicate cannot use a plain index on <code>email<\/code>.<\/p>\n<pre><code>-- EXPLAIN ANALYZE: Seq Scan\nSELECT id FROM customer WHERE lower(email) = lower($1);<\/code><\/pre>\n<h2>What breaks it<\/h2>\n<p>The team rewrites a LINQ micro-benchmark while that scan is the request. Store the normalized email, index the column the predicate uses, measure once, then change one thing.<\/p>\n<pre><code>SELECT id FROM customer WHERE email = $1;<\/code><\/pre>\n<h2>Pitfalls<\/h2>\n<ul>\n<li>Optimizing before a profile (especially micro-optimizing C# that is waiting on SQL).<\/li>\n<li>Load tests that never look like production traffic (no think time, no cache, one user id).<\/li>\n<li>Indexes on every column \u201cjust in case\u201d \u2014 write amplification, unused indexes.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A performance issue is a missed latency, throughput, or cost budget \u2014 not \u201cthe server feels slow.\u201d Start from a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[12],"tags":[],"class_list":["post-2932","post","type-post","status-publish","format-standard","hentry","category-quality-assurance"],"_links":{"self":[{"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/posts\/2932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/comments?post=2932"}],"version-history":[{"count":4,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/posts\/2932\/revisions"}],"predecessor-version":[{"id":3234,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/posts\/2932\/revisions\/3234"}],"wp:attachment":[{"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/media?parent=2932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/categories?post=2932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/contentlabstudy.com\/soft\/wp-json\/wp\/v2\/tags?post=2932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}