Skip to content

Instantly share code, notes, and snippets.

@mrpmorris
mrpmorris / BenchmarkReport.md
Created October 10, 2026 16:12
Read/Write Roslynk benchmarks

Persistent-server cumulative-feature benchmark

Generated 2026-10-10T16:01:11.102606+00:00

Independently checked correctness

Cumulative checkpoints are replayed forward into one separate grading checkout per approach, without reverting between tests. The final patch is checked against the resulting sources. Compiler builds, explicit existing-test commands, and the same 17 actual acceptance tests run at every edit checkpoint. Existing repository tests discover zero tests and are not used as behavioral evidence.

Approach Independent edit checkpoints Acceptance tests passed Final patch matches

PR #170 Review Tool Benchmark

This is a PR review of github.com/xoofx/SharpYaml/pull/170 using standard tools, Roslynk, and Roslyn LSP.

Summary

Standard tools were fastest and cheapest. Roslynk produced the most complete review in this run. Roslyn LSP incurred substantial client/setup overhead.

Method

Roslynk vs standard tools: code review of xoofx/SharpYaml#170

Prompt

I would like you to benchmark the usage of Roslynk against standard tools. You will review the PR github.com/xoofx/SharpYaml/pull/170

You will create 2 sessions that

  • One session will use Roslynk
  • One session will not use Roslynk
  • You will use git to pull the PR and rebase it on main
# Roslynk vs standard tools: code review of xoofx/SharpYaml#170
## Prompt
I would like you to benchmark the usage of Roslynk against standard tools.
You will review the PR github.com/xoofx/SharpYaml/pull/170
You will create 2 sessions that
- One session will use Roslynk
- One session will not use Roslynk
- You will use `git` to pull the PR and rebase it on main
@mrpmorris
mrpmorris / Program.cs
Last active October 2, 2024 13:45
Internal
using Microsoft.EntityFrameworkCore;
public abstract class EntityBase<TKey> where TKey : IEquatable<TKey>
{
public abstract TKey Id { get; set; }
}
public abstract class RepositoryBase<TDbContext, TEntity, TKey>
where TDbContext : DbContext, new()
where TEntity : EntityBase<TKey>
@mrpmorris
mrpmorris / Morris.Extensions.Aspire.ExternalSolutionSupport.csproj
Last active April 9, 2024 12:15
Prototype. Add references to SLN files without including them in your Aspire solution
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Morris.Extensions.Aspire.ExternalSolutionSupport</Title>
<PackageId>Morris.Extensions.Aspire.ExternalSolutionSupport</PackageId>
<Description>Referenced Solutions support for Aspire</Description>
<Nullable>enable</Nullable>
<ImplicitUsings>true</ImplicitUsings>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IsRoslynComponent>true</IsRoslynComponent>
<TargetFramework>netstandard2.0</TargetFramework>
@mrpmorris
mrpmorris / ConsoleApp153.csproj
Last active April 11, 2024 21:19
Proof that automapper can be faster than your own manually written code
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
@mrpmorris
mrpmorris / eggs.cs
Last active January 25, 2024 19:40
Convert string of floats to floats
static readonly char[] ExtractFloatsTrimChars = new char[] { '[', ']', ' ' };
static float[] ExtractFloats(string input) =>
input
.Trim(ExtractFloatsTrimChars)
.Split(',')
.Select(float.Parse)
.ToArray();
@mrpmorris
mrpmorris / ActivityTrackingMiddleware.cs
Last active January 21, 2024 18:26
Azure function telemetry
public class ActivityTrackingMiddleware : IFunctionsWorkerMiddleware
{
public const string ActivitySourceName = "AzureFunctionsWorker";
private readonly static ConcurrentDictionary<string, TriggerParameterInfo> FunctionIdToTriggerParameterInfoLookup = new();
private readonly static ActivitySource ActivitySource = new(ActivitySourceName);
private readonly HttpTriggerHandler HttpTriggerHandler;
private readonly ActivityTriggerHandler ActivityTriggerHandler;
private readonly FrozenDictionary<string, ICustomTriggerHandler> CustomTriggerHandlers;
@mrpmorris
mrpmorris / IQueryableExtensions.cs
Created October 13, 2022 15:14
OData sorting / filtering from Blazor TelerikGrid through to the server
using MyApp.Contracts;
using Community.OData.Linq;
using Microsoft.EntityFrameworkCore;
namespace CarePlace.AppLayer.Persistence;
internal static class IQueryableExtensions
{
public static IQueryable<T> ApplyODataParameters<T>(
this IQueryable<T> source,