Skip to content

Instantly share code, notes, and snippets.

View ReubenBond's full-sized avatar
🧊

Reuben Bond ReubenBond

🧊
View GitHub Profile
@ReubenBond
ReubenBond / OrleansBenchmarksConsolidated.md
Created November 11, 2025 23:52
OrleansBenchmarksConsolidated.md

ArrayDeserializeBenchmark

Method Runtime Mean Error StdDev Ratio RatioSD Gen0 Gen1 Gen2 Allocated Alloc Ratio
MessagePackDeserialize .NET 8.0 13.68 μs 0.152 μs 0.142 μs 1.00 0.01 0.0153 - - 12024 B 1.00
ProtobufNetDeserialize .NET 8.0 23.32 μs 0.147 μs 0.130 μs 1.71 0.02 - - - 12024 B 1.00
SystemTextJsonDeserialize .NET 8.0 60.99 μs 0.987 μs 0.875 μs 4.46 0.08 - - - 69272 B 5.76
OrleansDeserialize .NET 8.0 23.88 μs 0.216 μs 0.202 μs 1.75 0.02 - - - 12024 B 1.00
@ReubenBond
ReubenBond / CallChainSimulation.cs
Created March 24, 2025 18:12
CallChainSimulation.cs
using System.Diagnostics;
using System.Text;
int messageCount = 100;
var results = new List<SimulationResults>();
int[] hostCounts = [1, 2, 3, 6];
foreach (var n in hostCounts)
{
var simulator = new DistributedSimulator(n, depth: 10);
@ReubenBond
ReubenBond / virtual-sync-grain-directory.excalidraw
Last active July 29, 2024 22:49
VirtualSynchronyDirectory
{
"type": "excalidraw",
"version": 2,
"source": "https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor",
"elements": [
{
"id": "8ik7kpr0EhXC1TdRAjZhM",
"type": "ellipse",
"x": 500,
"y": 400.42667125531193,
@ReubenBond
ReubenBond / vsync.cs
Created July 20, 2024 02:33
Vsync v2.2.2095 by Ken Birman. Extracted from https://codeplexarchive.org/codeplex/project/vsync
This file has been truncated, but you can view the full file.
// <copyright file="Vsync.cs" company="Kenneth P. Birman">
// Vsync System, V2.2.$Rev: 2095 $, Developed by Kenneth P. Birman, (c) 2010 - 2014. All rights reserved.
// This code is subject to copyright and other intellectual property restrictions and
// may be used only under license from Dr. Birman or his designated agents.
//
// It is a violation of international intellectual property protection laws to remove this notice.
//
// Dr. Birman has elected to grant Cornell University and other researchers the right to experiment with Vsync and
// to create a derived version Vsync V2.2.xxxx (and other future versions, using the same version numbering scheme)
//
@ReubenBond
ReubenBond / FrequencyFilter.cs
Created April 13, 2024 23:07
Filtered Space-Saving
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Orleans.Runtime.Placement.Rebalancing;
// Implementation of "Filtered Space-Saving" from "Finding top-k elements in data streams"
// by Nuno Homem &amp; Joao Paulo Carvalho (https://www.hlt.inesc-id.pt/~fmmb/references/misnis.ref0a.pdf).
internal abstract class FrequencyFilter<TKey>(int capacity) where TKey : notnull
{
@ReubenBond
ReubenBond / ConcurrentLruGrainDirectoryCache.cs
Last active July 24, 2024 14:46
BitFaster.Caching Orleans IGrainDirectoryCache implementation
using BitFaster.Caching;
using BitFaster.Caching.Lru;
using Microsoft.Extensions.Options;
using Orleans.Configuration;
using Orleans.Runtime;
using Orleans.Runtime.GrainDirectory;
using System.Diagnostics.CodeAnalysis;
namespace Orleans.BitFasterCaching.GrainDirectoryCache;
@ReubenBond
ReubenBond / LongRunningReminderGrain.cs
Created January 17, 2024 16:46
Orleans Grain Long Running Reminder
#nullable enable
using Orleans.Runtime;
namespace MyGrains;
public class MyLongRunningReminderGrain : Grain, IRemindable
{
private readonly CancellationTokenSource _shutdownCancellation = new();
private Task? _backgroundTask;
@ReubenBond
ReubenBond / CpuUsage.cs
Created January 17, 2024 16:45
.NET CPU Usage EventCounter
using System.Diagnostics.Tracing;
using System.Security.Cryptography;
using System.Text;
public class Program
{
public static void Main(string[] args)
{
var listener = new SystemRuntimeEventCounterListener();
Task.Run(async () =>
{
"name": "Dactyl Manuform (5x7)",
"vendorProductId": 1145910583,
"macros": [
"{KC_LCTL,KC_LEFT}",
"{KC_LCTL,KC_DOWN}",
"{KC_LCTL,KC_UP}",
"{KC_LCTL,KC_RGHT}",
"",
"",
@ReubenBond
ReubenBond / HostedServiceCommunicationListener.cs
Last active December 1, 2022 21:10
Service Fabric IHostBuilder integration
namespace YOUR_NAMESPACE
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.ServiceFabric.Services.Communication.Runtime;
/// <summary>
/// Service Fabric <see cref="ICommunicationListener"/> which integrates with an <see cref="IHost"/> instance.