Skip to content

Instantly share code, notes, and snippets.

View devops-school's full-sized avatar

DevOps School devops-school

View GitHub Profile
@devops-school
devops-school / README.md
Created December 2, 2025 06:33
DOTNET: Kestrel-only / ASP.NET Core hosting-side performance techniques

1. Optimize Kestrel Endpoints & Protocols

  • What Configure Kestrel endpoints explicitly (ports, HTTPS, HTTP/2/HTTP/3), and disable protocols you don’t need.

  • Why

@devops-school
devops-school / Program.cs
Created December 1, 2025 05:44
DOTNET: RPC with GRPC and REST and its Performance Impact
using System.Diagnostics;
using System.Net.Http.Json;
using Grpc.Net.Client;
using RpcPerfDemo.Grpc;
// Simple POCO matching REST response shape
public class RestPerfResponse
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
@devops-school
devops-school / Program.cs
Created December 1, 2025 05:24
DOTNET: Memory Optimization in .NET with ValueTask
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
class Program
{
static void Main()
{
const int iterations = 5_000_000; // how many times we call the async API
@devops-school
devops-school / Program.cs
Created December 1, 2025 05:21
DOTNET: Memory Optimization in .NET with Span
using System;
using System.Diagnostics;
class Program
{
static void Main()
{
const int itemCount = 500_000; // number of strings to process
Console.WriteLine("=========================================");
Console.WriteLine(" Span<T> Demo – Substring vs Span ");
@devops-school
devops-school / Program.cs
Created December 1, 2025 05:17
DOTNET: Memory Optimization in .NET with Object Pooling
using System;
using System.Buffers;
using System.Diagnostics;
class Program
{
static void Main()
{
const int iterations = 1_000_000; // Total loop count for the main test
const int bufferSize = 1024; // Size of the byte[] buffer
@devops-school
devops-school / README.md
Created November 30, 2025 18:53
Grafana k6 OSS: Demo & Lab

Here’s a clean, copy-paste-ready beginner tutorial to install Grafana k6 OSS on Windows, write a “Hello World” load test, run it, and understand the results.


1. Install k6 on Windows

You have a few options. I’ll show the two easiest:

Option A – Using winget (recommended if available)

@devops-school
devops-school / AsyncBenchmarks.cs
Created November 27, 2025 06:15
BenchmarkDotNet: DOTNET Lab & Demo
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace BenchmarkDotNetLab
{
[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
@devops-school
devops-school / AllocationBenchmarks.cs
Created November 27, 2025 06:14
BenchmarkDotNet: DOTNET Lab & Demo
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using System;
using System.Text;
namespace BenchmarkDotNetLab
{
[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
[RankColumn]
@devops-school
devops-school / AllocationBenchmarks.cs
Created November 27, 2025 06:13
BenchmarkDotNet: DOTNET Lab & Demo
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using System;
using System.Text;
namespace BenchmarkDotNetLab
{
[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
[RankColumn]
@devops-school
devops-school / ComplexityBenchmarks.cs
Created November 27, 2025 06:12
BenchmarkDotNet: DOTNET Lab & Demo
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Order;
using System;
using System.Linq;
namespace BenchmarkDotNetLab
{
[MemoryDiagnoser]
[Orderer(SummaryOrderPolicy.FastestToSlowest)]
[RankColumn]