Skip to content

Instantly share code, notes, and snippets.

View kshyju's full-sized avatar

Shyju Krishnankutty kshyju

View GitHub Profile
{
"4.68.0": {
"templates": "https://functionscdn.azureedge.net/public/TemplatesApi/3.1.1648.zip",
"workerRuntimes": {
"dotnet": {
"net6": {
"displayInfo": {
"displayName": ".NET 6.0",
"hidden": false,
"displayVersion": "v4",
@kshyju
kshyju / EventPipeAOTSocketException.MD
Created January 22, 2024 17:22
GRPC Exception when AOT published with EventPipe support
Minimal repro app

https://github.com/kshyju/DotnetAppLoader/tree/case_2-aot-e2e-fails

Exception

Grpc.Core.RpcException: Status(StatusCode="Unavailable", Detail="Error connecting to subchannel.", DebugException="System.Net.Sockets.SocketException: Unknown error (0xffffffff)") ---> System.Net.Sockets.SocketException (0xFFFFFFFF): Unknown error (0xffffffff) at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError, CancellationToken) + 0x47 at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16) + 0x4e at System.Net.Sockets.Socket.<g__WaitForConnectWithCancellation|285_0>d.MoveNext() + 0x18f

@kshyju
kshyju / cli-feed4.json
Created November 15, 2023 19:33
4.62.0 vs 4.63.0
{
"4.63.0": {
"templates": "https://functionscdn.azureedge.net/public/TemplatesApi/3.1.1648.zip",
"workerRuntimes": {
"dotnet": {
"net6": {
"displayInfo": {
"displayName": ".NET 6.0",
"hidden": false,
"displayVersion": "v4",
@kshyju
kshyju / Linq_Where_First_Benchmarks.cs
Created February 8, 2023 18:20
LINQ Where+SingleOrDefault vs SingleOrDefault Benchmarks
using BenchmarkDotNet.Attributes;
namespace Benchmarks
{
public record Foo(string Name, string Value, int category);
[MemoryDiagnoser]
public class LinqBenchmarks
{
private IEnumerable<Foo> items;
@kshyju
kshyju / App.csproj
Last active September 7, 2023 16:33
ConsoleAppDI
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@kshyju
kshyju / V4NetFxcsproj.cs
Last active October 16, 2022 19:31
Blog2022AzureFunctionsV1toV4Migration
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.10.0" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.0.13" />
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.7.0" />
@kshyju
kshyju / CollectionBenchmarks.cs
Last active September 21, 2022 16:53
HashSet constructor vs autogrow benchmarks
[MemoryDiagnoser]
public class CollectionBenchmarks
{
string[] items = new string[] { "hello", "world", "some", "and", "one" };
[Benchmark]
public HashSet<string> AutoGrow()
{
var tpas = new HashSet<string>();
foreach (var tpa in items)
@kshyju
kshyju / EnumBenchMarkResults.MD
Created August 12, 2022 23:26
Enum benchmarks tp get enum value string
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.22000
11th Gen Intel Core i7-1185G7 3.00GHz, 1 CPU, 8 logical and 4 physical cores
.NET SDK=7.0.100-preview.7.22377.5
  [Host]     : .NET 6.0.8 (6.0.822.36306), X64 RyuJIT
  DefaultJob : .NET 6.0.8 (6.0.822.36306), X64 RyuJIT

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleAppNetFr481
{
internal class Program
{
@kshyju
kshyju / ControlStatementsBenchmarkResult.MD
Last active June 15, 2022 23:20
Benchmark results of IF-ELSE vs Switch statement
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.25141
Intel Xeon CPU E5-1650 v4 3.60GHz, 1 CPU, 12 logical and 6 physical cores
.NET SDK=6.0.300
  [Host]     : .NET 5.0.17 (5.0.1722.21314), X64 RyuJIT
  DefaultJob : .NET 5.0.17 (5.0.1722.21314), X64 RyuJIT