<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Maayur Dahake</title>
    <description>The latest articles on DEV Community by Maayur Dahake (@maayurdahake).</description>
    <link>https://dev.to/maayurdahake</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4240624%2F58fce6a5-4bfd-4287-9a9a-eb1291e6617c.png</url>
      <title>DEV Community: Maayur Dahake</title>
      <link>https://dev.to/maayurdahake</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maayurdahake"/>
    <language>en</language>
    <item>
      <title>SearchValues&lt;T&gt; in .NET 8/9 (.NET &amp; C#)</title>
      <dc:creator>Maayur Dahake</dc:creator>
      <pubDate>Thu, 12 Nov 2026 10:30:24 +0000</pubDate>
      <link>https://dev.to/maayurdahake/searchvalues-in-net-89-net-c-2i7d</link>
      <guid>https://dev.to/maayurdahake/searchvalues-in-net-89-net-c-2i7d</guid>
      <description>&lt;p&gt;Day 1/30 — SearchValues in .NET 8/9 (.NET &amp;amp; C#)&lt;/p&gt;

&lt;p&gt;Spotted string parsing bottlenecks during a recent code review where repeated IndexOfAny calls were triggering excessive CPU cycles on hot paths.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;SIMD Vectorization:&lt;/strong&gt; JIT compiler auto-vectorizes instructions to scan multiple bytes simultaneously across wide registers.&lt;br&gt;
• &lt;strong&gt;Heap Allocation:&lt;/strong&gt; Caching the SearchValues instance eliminates repeated array creation overhead inside tight loops.&lt;br&gt;
• &lt;strong&gt;Memory Safety:&lt;/strong&gt; Operating directly on ReadOnlySpan prevents unnecessary string slicing and Gen0 GC pressure.&lt;/p&gt;

&lt;p&gt;Watch out: Always cache SearchValues as a static readonly field to avoid costly instance initialization overhead on every method call.&lt;/p&gt;

&lt;p&gt;Have you benchmarked SIMD primitives in your ingestion pipelines yet?&lt;/p&gt;

&lt;h1&gt;
  
  
  DotNet #CSharp #Performance #BackendDevelopment #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>performance</category>
      <category>programming</category>
    </item>
    <item>
      <title>SearchValues&lt;T&gt; (.NET &amp; C#)</title>
      <dc:creator>Maayur Dahake</dc:creator>
      <pubDate>Thu, 12 Nov 2026 10:22:18 +0000</pubDate>
      <link>https://dev.to/maayurdahake/searchvalues-net-c-2fkm</link>
      <guid>https://dev.to/maayurdahake/searchvalues-net-c-2fkm</guid>
      <description>&lt;p&gt;Day 1/30 — SearchValues (.NET &amp;amp; C#)&lt;/p&gt;

&lt;p&gt;Spotted a hot path in a code review yesterday doing repeated char lookups against standard array allocations on every request.&lt;/p&gt;

&lt;p&gt;• &lt;strong&gt;Memory Profile:&lt;/strong&gt; Creating new char arrays inside loops causes unnecessary Gen0 GC pressure.&lt;br&gt;
• &lt;strong&gt;Instruction Set:&lt;/strong&gt; SearchValues caches vectorized tables at startup for SIMD register execution.&lt;br&gt;
• &lt;strong&gt;Span Boundary:&lt;/strong&gt; Operating directly on stack-allocated spans avoids managed heap overhead.&lt;/p&gt;

&lt;p&gt;Watch out: Always cache the instance statically; recreating it defeats the vectorization gains.&lt;/p&gt;

&lt;p&gt;What high-frequency parser are you profiling this week?&lt;/p&gt;

&lt;h1&gt;
  
  
  DotNet #CSharp #Performance #BackendDevelopment #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>performance</category>
      <category>programming</category>
    </item>
    <item>
      <title>SearchValues&lt;T&gt; in .NET 8/9 (.NET &amp; C#)</title>
      <dc:creator>Maayur Dahake</dc:creator>
      <pubDate>Thu, 12 Nov 2026 10:14:44 +0000</pubDate>
      <link>https://dev.to/maayurdahake/searchvalues-in-net-89-net-c-132h</link>
      <guid>https://dev.to/maayurdahake/searchvalues-in-net-89-net-c-132h</guid>
      <description>&lt;p&gt;Day 1/30 — SearchValues in .NET 8/9 (.NET &amp;amp; C#)&lt;/p&gt;

&lt;p&gt;Spotted a hot path in a string parser allocating megabytes on Gen0 just checking punctuation marks.&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;','&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;';'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Triggers internal array allocations&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="k"&gt;readonly&lt;/span&gt; &lt;span class="nc"&gt;SearchValues&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;S&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;SearchValues&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;",;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;AsSpan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ContainsAny&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;S&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Executes via vectorized CPU instructions&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why it matters:&lt;br&gt;
• &lt;strong&gt;SearchValues Cache:&lt;/strong&gt; Pre-computes lookup tables once at startup to avoid repeated overhead.&lt;br&gt;
• &lt;strong&gt;SIMD Vectorization:&lt;/strong&gt; Processes 16 to 64 bytes per CPU cycle depending on hardware vector width.&lt;br&gt;
• &lt;strong&gt;Zero Allocations:&lt;/strong&gt; Operates entirely on ReadOnlySpan without boxing or heap pressure.&lt;/p&gt;

&lt;p&gt;Watch out: Creating the SearchValues instance inside a tight loop negates all performance gains.&lt;/p&gt;

&lt;p&gt;What is your go-to trick for reducing string parser allocations?&lt;/p&gt;

&lt;h1&gt;
  
  
  DotNet #CSharp #Performance #BackendDevelopment #SoftwareEngineering
&lt;/h1&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>performance</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
