This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Order; | |
| using System; | |
| using System.Text; | |
| namespace BenchmarkDotNetLab | |
| { | |
| [MemoryDiagnoser] | |
| [Orderer(SummaryOrderPolicy.FastestToSlowest)] | |
| [RankColumn] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Order; | |
| using System; | |
| using System.Text; | |
| namespace BenchmarkDotNetLab | |
| { | |
| [MemoryDiagnoser] | |
| [Orderer(SummaryOrderPolicy.FastestToSlowest)] | |
| [RankColumn] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Order; | |
| using System; | |
| using System.Linq; | |
| namespace BenchmarkDotNetLab | |
| { | |
| [MemoryDiagnoser] | |
| [Orderer(SummaryOrderPolicy.FastestToSlowest)] | |
| [RankColumn] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Order; | |
| using System; | |
| using System.Linq; | |
| namespace BenchmarkDotNetLab | |
| { | |
| // Captures allocations & GC info | |
| [MemoryDiagnoser] | |
| // Rank methods from fastest to slowest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| // Minimal API demo to show bad vs good threading practices in .NET | |
| var builder = WebApplication.CreateBuilder(args); | |
| var app = builder.Build(); | |
| // Simple concurrency metrics |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.WriteLine("========================================="); | |
| Console.WriteLine(" .NET GC Generations Demo (Gen0/1/2) "); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics; | |
| using System.Text; | |
| var builder = WebApplication.CreateBuilder(args); | |
| var app = builder.Build(); | |
| // =============================================== | |
| // INTENTIONAL MEMORY LEAK DEMO | |
| // =============================================== | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Diagnostics; | |
| using System.Net; | |
| using System.Security.Authentication; | |
| using System.Threading; | |
| // Simple .NET minimal API to demo TLS 1.2 vs TLS 1.3 impact | |
| // and expose basic in-process metrics at /metrics | |
| var builder = WebApplication.CreateBuilder(args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ============================================================ | |
| // Circular Dependency Example (BAD) + Fixed Example (GOOD) | |
| // Single-file demonstration for training | |
| // ============================================================ | |
| using System; | |
| using Microsoft.Extensions.DependencyInjection; | |
| namespace CircularDependencyDemo | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $host = 'n1smtpout.europe.secureserver.net'; | |
| $port = 25; | |
| $from = 'contact@guestpostai.com'; | |
| $to = 'contact@guestpostai.com'; | |
| echo "<pre>Connecting to SMTP ($host:$port)...\n"; |