Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Author: ErcanOPAK

Asp.Net Core

.NET Core — Logging Too Much Can DOS Your Own App

- 25.12.25 - ErcanOPAK comment on .NET Core — Logging Too Much Can DOS Your Own App

Excessive logging is a performance bug. ❌ Symptoms Disk IO spikes Thread pool starvation ✅ Rule Log events, not flows.

Read More
Asp.Net Core

.NET Core — Kestrel Has Request Limits You Might Hit

- 25.12.25 - ErcanOPAK comment on .NET Core — Kestrel Has Request Limits You Might Hit

Large uploads fail silently. Default limits Request body size Header count Header length ✅ Fix Explicitly configure limits in Kestrel.

Read More
SQL

SQL Server — Scalar UDFs Kill Query Parallelism

- 25.12.25 - ErcanOPAK comment on SQL Server — Scalar UDFs Kill Query Parallelism

Scalar functions force serial execution. ❌ Result CPU spikes Slow reports ✅ Fix Inline logic or use inline table-valued functions.

Read More
SQL

SQL Server — TOP (1) Without ORDER BY Is Undefined

- 25.12.25 - ErcanOPAK comment on SQL Server — TOP (1) Without ORDER BY Is Undefined

SELECT TOP 1 * FROM Orders ❌ Problem Result can change between executions. ✅ Always do ORDER BY CreatedAt DESC  

Read More
C#

C# — Async State Machines Increase Memory Usage

- 25.12.25 - ErcanOPAK comment on C# — Async State Machines Increase Memory Usage

Every async method allocates a state machine. 🧠 Impact High-throughput services suffer Hot paths amplify cost ✅ Optimization Use sync methods when no awaits are needed.

Read More
C#

C# — ConcurrentDictionary Is Not Always Faster

- 25.12.25 - ErcanOPAK comment on C# — ConcurrentDictionary Is Not Always Faster

Many devs replace Dictionary blindly. ❌ Reality Slower for low contention Higher memory usage Locks still exist internally ✅ Rule Use ConcurrentDictionary only under real concurrency.

Read More
C#

C# — Why readonly struct Can Be Slower Than class

- 25.12.25 - ErcanOPAK comment on C# — Why readonly struct Can Be Slower Than class

readonly struct looks like a performance win. ❌ Hidden cost Defensive copies are created when passed by value Happens silently in method calls ✅ Fix Pass by in: void Process(in MyStruct value)  

Read More
Visual Studio

Visual Studio — Solution Filters Save Massive Load Time

- 21.12.25 - ErcanOPAK comment on Visual Studio — Solution Filters Save Massive Load Time

Large solutions load slowly. Fix Use .slnf (Solution Filter) Load only what you need Faster startup Lower memory usage

Read More
Wordpress

WordPress — wp_posts Without Indexes Is a Time Bomb

- 21.12.25 - ErcanOPAK comment on WordPress — wp_posts Without Indexes Is a Time Bomb

Large blogs suffer without proper indexes. Must-have (post_type, post_status) (post_date) Speeds up homepage and archives drastically.

Read More
Windows

Windows 11 — NTFS Compression Slows Modern SSDs

- 21.12.25 - ErcanOPAK comment on Windows 11 — NTFS Compression Slows Modern SSDs

Compression helped HDDs — not SSDs. Recommendation Disable NTFS compression on code folders.

Read More
Windows

Windows 11 — Fast Startup Breaks Dual Boot & Updates

- 21.12.25 - ErcanOPAK comment on Windows 11 — Fast Startup Breaks Dual Boot & Updates

Fast Startup isn’t a full shutdown. Fix Disable it in Power Options to avoid: Locked filesystems Update failures Boot inconsistencies

Read More
Ajax / JavaScript

AJAX — Network Tab Lies About Timing

- 21.12.25 | 21.12.25 - ErcanOPAK comment on AJAX — Network Tab Lies About Timing

Browser timing includes: DNS SSL Queuing Connection reuse Real insight Use Server-Timing headers for truth.

Read More
JavaScript

JavaScript — structuredClone() Beats JSON Tricks

- 21.12.25 - ErcanOPAK comment on JavaScript — structuredClone() Beats JSON Tricks

Instead of: JSON.parse(JSON.stringify(obj)) Use: structuredClone(obj); Why Preserves Dates, Maps, Sets Faster Safer

Read More
HTML

HTML5 — Is Still Often Wrong

- 21.12.25 - ErcanOPAK comment on HTML5 — Is Still Often Wrong

Bad viewport = broken mobile UX. <meta name=”viewport” content=”width=device-width, initial-scale=1″> Without this, mobile layouts lie.

Read More
CSS

CSS — contain Property Prevents Reflow Cascades

- 21.12.25 - ErcanOPAK comment on CSS — contain Property Prevents Reflow Cascades

.card { contain: layout paint; } Why this is huge Stops layout recalculation spreading Massive UI performance win on large pages

Read More
Asp.Net Core / C#

.NET Core — Response Compression Isn’t Enabled by Default

- 21.12.25 - ErcanOPAK comment on .NET Core — Response Compression Isn’t Enabled by Default

Many APIs forget this. builder.Services.AddResponseCompression(); app.UseResponseCompression(); Result Smaller payloads Faster mobile clients Lower bandwidth costs

Read More
Asp.Net Core / C#

.NET Core — MapGroup() for API Versioning Without Pain

- 21.12.25 - ErcanOPAK comment on .NET Core — MapGroup() for API Versioning Without Pain

var v1 = app.MapGroup(“/api/v1”); v1.MapGet(“/users”, GetUsers); Benefits Cleaner routing Shared filters & auth Scales beautifully

Read More
SQL

SQL Server — Nonclustered Index INCLUDE Is a Superpower

- 21.12.25 - ErcanOPAK comment on SQL Server — Nonclustered Index INCLUDE Is a Superpower

CREATE INDEX IX_User_Email ON Users(Id) INCLUDE (Email, CreatedAt) Why this matters Eliminates key lookups Massive speedups for read-heavy queries

Read More
SQL

SQL Server — COUNT(*) vs COUNT(column) Is Not the Same

- 21.12.25 - ErcanOPAK comment on SQL Server — COUNT(*) vs COUNT(column) Is Not the Same

SELECT COUNT(*) FROM Orders Why COUNT(*) is faster Doesn’t check for NULL Uses metadata when possible Avoid COUNT(column) unless required.

Read More
C#

C# — Boxing in Interfaces Slows Hot Paths

- 21.12.25 - ErcanOPAK comment on C# — Boxing in Interfaces Slows Hot Paths

void Log(IFormattable value) Passing structs through interfaces causes boxing. Fix Use generics: void Log<T>(T value) where T : IFormattable Result: zero allocations, faster execution.

Read More
C#

C# — WeakReference Prevents Hidden Memory Leaks

- 21.12.25 - ErcanOPAK comment on C# — WeakReference Prevents Hidden Memory Leaks

Event subscriptions can keep objects alive forever. var weak = new WeakReference<MyService>(service); Use case Caching Event listeners Plugin systems Prevents objects from surviving longer than intended.

Read More
C#

C# — ArrayPool: Stop Allocating, Start Reusing

- 21.12.25 - ErcanOPAK comment on C# — ArrayPool: Stop Allocating, Start Reusing

Allocating large arrays repeatedly kills performance. var pool = ArrayPool<byte>.Shared; var buffer = pool.Rent(4096); // use buffer pool.Return(buffer); Why this matters Reduces GC pressure dramatically Ideal for serializers, streams, IO-heavy code Used internally by ASP.NET Core ⚠ Always return the array — leaks are silent.

Read More
Visual Studio

IntelliSense Slow? It’s the Node.js Server

- 19.12.25 - ErcanOPAK comment on IntelliSense Slow? It’s the Node.js Server

VS runs a Node process for JS/TS language services. ✅ Fix Restart TS server from command palette.

Read More
Wordpress

WP-Cron Runs on User Requests (Not Real Cron)

- 19.12.25 - ErcanOPAK comment on WP-Cron Runs on User Requests (Not Real Cron)

Low traffic = delayed jobs. ✅ Fix Disable WP-Cron and use system cron instead.

Read More
Windows

WSL2 Eating RAM Even When Idle

- 19.12.25 - ErcanOPAK comment on WSL2 Eating RAM Even When Idle

WSL does not release memory by default. ✅ Fix Add .wslconfig: memory=4GB  

Read More
Windows

Windows 11 Killing Background Tasks Aggressively

- 19.12.25 - ErcanOPAK comment on Windows 11 Killing Background Tasks Aggressively

Modern standby suspends background apps. ✅ Fix Disable aggressive power throttling per app.

Read More
Ajax / JavaScript

Silent JSON Parsing Failures

- 19.12.25 | 19.12.25 - ErcanOPAK comment on Silent JSON Parsing Failures

Backend returns HTML error page → JS crashes silently. ✅ Fix Always check: response.headers.get(“content-type”) Before parsing JSON.

Read More
JavaScript

Microtasks vs Macrotasks — Why setTimeout(0) Lies

- 19.12.25 - ErcanOPAK comment on Microtasks vs Macrotasks — Why setTimeout(0) Lies

Promise.then() // microtask setTimeout() // macrotask 🔥 Reality Microtasks run before repaint. This affects rendering bugs and race conditions.

Read More
HTML

required Attribute Is NOT Validation

- 19.12.25 - ErcanOPAK comment on required Attribute Is NOT Validation

HTML validation can be bypassed easily. ✅ Rule Never trust client-side validation. Always validate server-side.

Read More
CSS

position: sticky Stops Working Because of Parents

- 19.12.25 - ErcanOPAK comment on position: sticky Stops Working Because of Parents

Sticky fails if any parent has: overflow: hidden; 🧠 Fix Remove overflow or move sticky element higher.

Read More
Page 52 of 69
« Previous 1 … 47 48 49 50 51 52 53 54 55 56 57 … 69 Next »

Posts navigation

Older posts
Newer posts
April 2026
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
27282930  
« Mar    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)
  • Add Constraint to SQL Table to ensure email contains @ (578)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (564)
  • Average of all values in a column that are not zero in SQL (531)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (489)
  • Find numbers with more than two decimal places in SQL (447)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries
  • SQL: Use Window Functions for Advanced Analytical Queries
  • .NET Core: Use Background Services for Long-Running Tasks
  • .NET Core: Use Minimal APIs for Lightweight HTTP Services
  • Git: Use Cherry-Pick to Apply Specific Commits Across Branches
  • Git: Use Interactive Rebase to Clean Up Commit History Before Merge

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (950)
  • How to add default value for Entity Framework migrations for DateTime and Bool (858)
  • Get the First and Last Word from a String or Sentence in SQL (836)
  • How to select distinct rows in a datatable in C# (805)
  • How to make theater mode the default for Youtube (754)

Recent Posts

  • C#: Use Init-Only Setters for Immutable Objects After Construction
  • C#: Use Expression-Bodied Members for Concise Single-Line Methods
  • C#: Enable Nullable Reference Types to Eliminate Null Reference Exceptions
  • C#: Use Record Types for Immutable Data Objects
  • SQL: Use CTEs for Readable Complex Queries

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com