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

Windows

Fix Sudden SSD Slowdowns Caused by Storage Sense

- 30.01.26 - ErcanOPAK comment on Fix Sudden SSD Slowdowns Caused by Storage Sense

Storage Sense sounds harmless… until it isn’t. What it does Cleans temp files aggressively Can interfere with active build caches Triggers background disk IO Fix Disable Storage Sense on dev machines.

Read More
Windows

Why Windows 11 Randomly Feels Sluggish After Updates

- 30.01.26 - ErcanOPAK comment on Why Windows 11 Randomly Feels Sluggish After Updates

Performance tanks after updates, even on high-end machines. Hidden cause Background re-indexing Defender rescans system files Power plan resets Fix Lock High Performance plan Exclude dev folders from Defender Disable unnecessary startup tasks

Read More
AI

Reduce Mental Overload Without Losing Productivity

- 30.01.26 - ErcanOPAK comment on Reduce Mental Overload Without Losing Productivity

This one is shockingly useful for everyone. Prompt Act as a cognitive load specialist. Analyze my daily workload and: – Identify energy drains – Separate urgent vs important tasks – Suggest batching strategies – Design a low-friction daily structure This prompt optimizes thinking capacity, not just time.

Read More
AI

Turn Bug Reports Into Reproducible Test Cases

- 30.01.26 - ErcanOPAK comment on Turn Bug Reports Into Reproducible Test Cases

Bug reports are often vague. This prompt fixes that. Prompt You are a QA automation engineer. Given this bug description: – Extract reproducible steps – Identify missing assumptions – Create a minimal failing test case – Suggest assertions to prevent regression Why it works It transforms chaos into deterministic input.

Read More
AI

Find Hidden Performance Bottlenecks in Backend Code

- 30.01.26 - ErcanOPAK comment on Find Hidden Performance Bottlenecks in Backend Code

Most profilers show where time is spent — not why. Prompt Act as a senior performance engineer. Analyze this backend code and: – Identify hidden O(N) or O(N²) patterns – Flag unnecessary allocations – Suggest low-risk performance wins – Explain why each change improves performance Assume production load and real users. Why this works It […]

Read More
Docker

Why Docker Containers Randomly Slow Down After Days (Even With Low Traffic)

- 30.01.26 - ErcanOPAK comment on Why Docker Containers Randomly Slow Down After Days (Even With Low Traffic)

If a container runs for days, performance can degrade without any load increase. What actually happens Linux page cache grows but isn’t reclaimed fast enough Log files inside containers expand silently OverlayFS layers fragment over time Golden principle Containers are ephemeral by design, not meant to be immortal. Fix Externalize logs Restart containers on a […]

Read More
Kubernetes

Why Pods Restart Even When CPU & Memory Look Fine

- 30.01.26 - ErcanOPAK comment on Why Pods Restart Even When CPU & Memory Look Fine

Everything green… pods still restart. Hidden killer Liveness probes too aggressive Short timeouts during GC pauses Cold starts under load Fix Separate readiness & liveness Increase initialDelaySeconds Avoid HTTP probes on heavy endpoints livenessProbe: initialDelaySeconds: 30 timeoutSeconds: 5  

Read More
Wordpress

Why “Just Disable Plugins” Is the Wrong Performance Advice

- 30.01.26 - ErcanOPAK comment on Why “Just Disable Plugins” Is the Wrong Performance Advice

Plugins aren’t slow. Bad hooks are. What actually hurts init hooks doing heavy logic Unconditional database queries Hooks running on admin + frontend Fix Profile hooks Load logic conditionally Split admin/frontend hooks

Read More
Wordpress

Why WordPress Admin Gets Slower Even Without Traffic

- 30.01.26 - ErcanOPAK comment on Why WordPress Admin Gets Slower Even Without Traffic

Low traffic, fast server… yet wp-admin crawls. Actual culprit Autoloaded options table Plugins storing large serialized blobs in wp_options Diagnosis SELECT option_name, LENGTH(option_value) FROM wp_options WHERE autoload=’yes’ ORDER BY LENGTH(option_value) DESC; Why it matters Autoloaded options load on every request.

Read More
Photoshop

Non-Destructive Editing Isn’t Just Safer — It’s Faster

- 30.01.26 - ErcanOPAK comment on Non-Destructive Editing Isn’t Just Safer — It’s Faster

Flattening layers feels faster… until it isn’t. Why non-destructive wins Adjustment layers are GPU-accelerated Smart Filters re-render selectively Layer flattening forces full re-rasterization Rule Keep layers. Let GPU do the work.

Read More
Photoshop

Why Photoshop Gets Slower After Long Editing Sessions

- 30.01.26 - ErcanOPAK comment on Why Photoshop Gets Slower After Long Editing Sessions

Photoshop doesn’t “leak memory”… it hoards it. Hidden behavior Undo history is RAM-heavy Smart Objects stay cached GPU memory isn’t released aggressively Fix Reduce History States Periodically close & reopen PSDs Purge clipboard + histories Edit → Purge → All  

Read More
Visual Studio

Why Visual Studio IntelliSense Gets Slower as Your Solution Grows

- 30.01.26 - ErcanOPAK comment on Why Visual Studio IntelliSense Gets Slower as Your Solution Grows

Big solution, many projects… suddenly IntelliSense feels drunk. Root cause Visual Studio keeps: Symbol cache per project Roslyn analysis results Design-time builds running in background These accumulate and slow down parsing. Fix (safe & underrated) Disable design-time builds for large solutions Clear ComponentModelCache periodically %LOCALAPPDATA%\Microsoft\VisualStudio\<version>\ComponentModelCache Why it works Forces VS to rebuild symbol graphs cleanly.

Read More
C#

Why foreach Is Sometimes Slower Than for

- 29.01.26 - ErcanOPAK comment on Why foreach Is Sometimes Slower Than for

Not always — but when it matters, it matters. Reason Enumerator allocations Interface dispatch Bounds checks differ Critical paths Use for on arrays and spans. for (int i = 0; i < arr.Length; i++) { Process(arr[i]); }  

Read More
C#

The Hidden Cost of Exceptions as Flow Control

- 29.01.26 - ErcanOPAK comment on The Hidden Cost of Exceptions as Flow Control

Exceptions are expensive. Bad try { Parse(input); } catch { } Better if (TryParse(input, out var result)) { … } Why Exceptions unwind stacks and allocate memory.

Read More
C#

Why lock Can Kill Throughput

- 29.01.26 - ErcanOPAK comment on Why lock Can Kill Throughput

Locks serialize execution. Bad lock(_sync) { Process(); } Better Reduce lock scope Prefer immutable data Use ConcurrentDictionary Why CPU cores idle while waiting.

Read More
SQL

Indexes Can Make Queries Slower (Here’s Why)

- 29.01.26 - ErcanOPAK comment on Indexes Can Make Queries Slower (Here’s Why)

Too many indexes = slower writes. Why Every INSERT/UPDATE must update all indexes. Rule Indexes are not free. Audit sys.dm_db_index_usage_stats  

Read More
SQL

Why SELECT * Slowly Destroys Performance

- 29.01.26 - ErcanOPAK comment on Why SELECT * Slowly Destroys Performance

It’s not about bandwidth — it’s about execution plans. Problems Wider rows = more IO Breaks covering indexes Schema changes silently hurt queries Fix Always project explicitly: SELECT Id, Name, CreatedAt FROM Users;  

Read More
Asp.Net Core / C#

The Real Cost of IHostedService Misuse

- 29.01.26 - ErcanOPAK comment on The Real Cost of IHostedService Misuse

Background services look harmless… until production. Common mistake Long-running loops No cancellation handling Blocking delays Correct pattern while (!stoppingToken.IsCancellationRequested) { await DoWorkAsync(stoppingToken); await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken); } Why Graceful shutdowns save data and prevent zombie processes.

Read More
Asp.Net Core / C#

Why Async Controllers Still Block Threads

- 29.01.26 - ErcanOPAK comment on Why Async Controllers Still Block Threads

Async ≠ non-blocking. The trap public async Task<IActionResult> Get() { var data = _service.GetDataAsync().Result; return Ok(data); } Why it blocks .Result blocks the request thread Can cause thread starvation under load Fix var data = await _service.GetDataAsync();  

Read More
Git

Stop Using git pull (Yes, Really)

- 29.01.26 - ErcanOPAK comment on Stop Using git pull (Yes, Really)

git pull = fetch + mergeYou lose control. Better git fetch git rebase origin/main Why Cleaner history Fewer merge commits Easier rollback Rule Explicit is safer than automatic.

Read More
Git

Why Git Rebase “Loses” Commits (It Doesn’t — You Did)

- 29.01.26 - ErcanOPAK comment on Why Git Rebase “Loses” Commits (It Doesn’t — You Did)

Commits aren’t deleted — they’re detached. What actually happens Rebase rewrites history Old commits lose branch references They become unreachable, not gone Recovery git reflog git checkout <lost-commit-hash> Lesson If Git feels scary, you’re missing the mental model, not commands.

Read More
Ajax / JavaScript

Why Fetch Requests “Randomly” Hang (But Server Is Fine)

- 29.01.26 - ErcanOPAK comment on Why Fetch Requests “Randomly” Hang (But Server Is Fine)

AJAX requests stall… server logs show nothing. Hidden reason Browsers limit parallel connections per origin (usually 6). When it happens Long-polling Hanging fetch calls Images + API calls from same domain Fix Abort unused requests Use AbortController const controller = new AbortController(); fetch(url, { signal: controller.signal }); // later controller.abort();  

Read More
JavaScript

Why setTimeout(fn, 0) Is NOT Immediate (And Breaks Logic)

- 29.01.26 - ErcanOPAK comment on Why setTimeout(fn, 0) Is NOT Immediate (And Breaks Logic)

Many developers assume setTimeout(fn, 0) runs instantly.It never does. Why JavaScript has a single-threaded event loop setTimeout callbacks go to the macrotask queue Rendering, promises, microtasks run first console.log(‘A’); setTimeout(() => console.log(‘B’), 0); Promise.resolve().then(() => console.log(‘C’)); console.log(‘D’); Output A D C B Impact Race conditions UI glitches Unexpected async order Fix Use microtasks when order […]

Read More
HTML

Stop Breaking Mobile Layouts: Viewport Isn’t Optional

- 29.01.26 - ErcanOPAK comment on Stop Breaking Mobile Layouts: Viewport Isn’t Optional

Missing or incorrect viewport causes: Zoomed pages Tiny text Broken responsive layouts Correct <meta name=”viewport” content=”width=device-width, initial-scale=1″> Why Mobile browsers emulate desktop width without it.

Read More
CSS

Why position: sticky Randomly Stops Working

- 29.01.26 - ErcanOPAK comment on Why position: sticky Randomly Stops Working

Sticky works… until it doesn’t. Actual rules Parent must NOT have overflow: hidden|auto|scroll Sticky only works within scroll container Z-index context matters Fix Move sticky element outside overflow containers.

Read More
Windows

Fix File Explorer Lag Caused by Context Menu Extensions

- 29.01.26 - ErcanOPAK comment on Fix File Explorer Lag Caused by Context Menu Extensions

Right-click lag = third-party shell extensions. Diagnosis Use ShellExView → disable non-Microsoft handlers. Why this matters Explorer loads every registered handler on right-click.

Read More
Windows

Why Windows 11 Randomly Resets Power Plans

- 29.01.26 - ErcanOPAK comment on Why Windows 11 Randomly Resets Power Plans

Laptop suddenly throttles. Fans silent. Performance tanks. Hidden cause Windows Update silently resets: Power plan CPU min/max state PCI Express power management Fix Duplicate your power plan Never use “Balanced” Lock CPU minimum to 100% when plugged

Read More
AI

Make Better Decisions Under Uncertainty

- 29.01.26 - ErcanOPAK comment on Make Better Decisions Under Uncertainty

This one is gold for life, work, leadership. Prompt You are a decision analyst. Given this situation: – Identify unknowns vs unknowables – List reversible vs irreversible decisions – Suggest a bias-resistant decision framework – Highlight emotional traps Optimize for long-term optionality. This reduces bad decisions caused by urgency or fear.

Read More
AI

Debug Race Conditions Instead of Guessing

- 29.01.26 - ErcanOPAK comment on Debug Race Conditions Instead of Guessing

Race conditions are where AI shines if prompted correctly. Prompt Act as a concurrency specialist. Given this code: – Identify all shared mutable state – Explain possible execution orders – Point out where timing issues may occur – Propose minimal fixes (not rewrites) Assume multi-core execution under load. Why it works AI reasons through execution […]

Read More
AI

Turn Any Legacy Codebase Into a Refactoring Roadmap

- 29.01.26 | 29.01.26 - ErcanOPAK comment on Turn Any Legacy Codebase Into a Refactoring Roadmap

Most AI prompts fail because they’re vague.This one produces actionable engineering output. Prompt You are a senior software architect. Analyze the following codebase and: 1. Identify architectural smells 2. Rank refactoring tasks by risk and ROI 3. Suggest safe refactor order with reasoning 4. Flag changes that could break backward compatibility Assume this is a […]

Read More
Page 26 of 69
« Previous 1 … 21 22 23 24 25 26 27 28 29 30 31 … 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