<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Performance on Java &amp; Software Architecture Knowledge Hub</title><link>https://samirsahoo.github.io/design-patterns-hub/tags/performance/</link><description>Recent content in Performance on Java &amp; Software Architecture Knowledge Hub</description><generator>Hugo</generator><language>en-US</language><copyright>© 2026 Samir Kumar Sahoo (https://github.com/samirsahoo). All rights reserved.</copyright><atom:link href="https://samirsahoo.github.io/design-patterns-hub/tags/performance/index.xml" rel="self" type="application/rss+xml"/><item><title>Reliability, Scalability and Maintainability</title><link>https://samirsahoo.github.io/design-patterns-hub/data-systems/reliability-scalability-maintainability/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/data-systems/reliability-scalability-maintainability/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Applications today are usually &lt;strong&gt;data-intensive&lt;/strong&gt; rather than compute-intensive: the hard problems are the amount of data, its complexity and how fast it changes. Such applications are assembled from standard building blocks — databases, caches, search indexes, stream processors, batch jobs — and the application code that glues them together.&lt;/p&gt;</description></item><item><title>Entity Mappings and Fetch Strategies: Lazy vs Eager and the N+1 Problem</title><link>https://samirsahoo.github.io/design-patterns-hub/spring/data/entity-mappings-and-fetch-strategies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/spring/data/entity-mappings-and-fetch-strategies/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Entity mappings&lt;/strong&gt; tell JPA how classes and their associations map to tables and foreign keys. &lt;strong&gt;Fetch strategies&lt;/strong&gt; decide &lt;strong&gt;when&lt;/strong&gt; associated data is loaded: &lt;strong&gt;eagerly&lt;/strong&gt; (with the parent) or &lt;strong&gt;lazily&lt;/strong&gt; (on first access, through a proxy).&lt;/p&gt;</description></item><item><title>Caching Strategies: Patterns, Invalidation, Eviction and Failure Modes</title><link>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/system-design/building-blocks/caching-strategies/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;A &lt;strong&gt;cache&lt;/strong&gt; is a small, fast store holding copies of data that is expensive to fetch or compute. It works because of &lt;strong&gt;locality of reference&lt;/strong&gt;: recently requested data is likely to be requested again. Caches exist at almost every layer — hardware, operating system, browser, CDN, application, database — and they are the cheapest way to cut latency and load.&lt;/p&gt;</description></item><item><title>Garbage Collection: G1, ZGC and Tuning Basics</title><link>https://samirsahoo.github.io/design-patterns-hub/java/advanced/garbage-collection/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/java/advanced/garbage-collection/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;Garbage collection (GC)&lt;/strong&gt; automatically frees heap memory used by objects that the program &lt;strong&gt;can no longer reach&lt;/strong&gt;. The JVM ships several collectors that trade &lt;strong&gt;pause time&lt;/strong&gt;, &lt;strong&gt;throughput&lt;/strong&gt; and &lt;strong&gt;memory overhead&lt;/strong&gt; differently.&lt;/p&gt;&#10;&lt;h2 id="the-problem"&gt;The problem&lt;a class="heading-anchor" href="#the-problem" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Manual memory management causes leaks and use-after-free bugs. Automatic GC removes those but costs CPU and sometimes &lt;strong&gt;pauses&lt;/strong&gt; the application. The right collector and heap size can turn 2-second pauses into sub-millisecond ones, or double throughput.&lt;/p&gt;</description></item><item><title>Spring Cache Abstraction and Redis Integration</title><link>https://samirsahoo.github.io/design-patterns-hub/spring/data/caching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/spring/data/caching/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;Spring Cache abstraction&lt;/strong&gt; lets you cache method results declaratively with &lt;code&gt;@Cacheable&lt;/code&gt; and friends. &lt;strong&gt;Where&lt;/strong&gt; data is cached is pluggable: &lt;strong&gt;Caffeine&lt;/strong&gt; in local memory, &lt;strong&gt;Redis&lt;/strong&gt; (or Valkey) shared across instances, Hazelcast and others.&lt;/p&gt;&#10;&lt;h2 id="the-problem"&gt;The problem&lt;a class="heading-anchor" href="#the-problem" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Repeated expensive calls (database aggregations, remote price lookups, reference data) waste latency and load. Ad-hoc &lt;code&gt;Map&lt;/code&gt; caches have no eviction or TTL, are not shared, and are scattered through the code.&lt;/p&gt;</description></item><item><title>Flyweight Pattern</title><link>https://samirsahoo.github.io/design-patterns-hub/design-patterns/structural/flyweight/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://samirsahoo.github.io/design-patterns-hub/design-patterns/structural/flyweight/</guid><description>&lt;h2 id="simple-definition"&gt;Simple definition&lt;a class="heading-anchor" href="#simple-definition" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;Flyweight&lt;/strong&gt; pattern saves memory when a program needs a very large number of similar objects. It splits each object&amp;rsquo;s state into:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;intrinsic state&lt;/strong&gt;: shared, immutable and independent of context, stored once in a shared flyweight object&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;extrinsic state&lt;/strong&gt;: varies per object and is stored (or passed in) by the context.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;A &lt;strong&gt;factory&lt;/strong&gt; makes sure each distinct flyweight exists only once.&lt;/p&gt;</description></item></channel></rss>