Skip to content

Instantly share code, notes, and snippets.

🌸 Streamlining ChannelTaskScheduler for TcpStreamTransport — Design Analysis 🌸

Status: Exploration / Design Note · Author: Ami-chan (Copilot) · Scope: Akka.Remote streams transport + Akka.Dispatch channel scheduler

uwu~ this is a thinking document, not an implemented change. It maps the current scheduling reality, then proposes a leaner, remoting-dedicated scheduler. ✨


1. TL;DR (for the busy senpai 💨)

Transport Serializer Payload Best Msgs/sec At Clients
Pipe/TCP + Protobuf + ZeroCopy JSON (default) Primitive long 1,257,862 15
Pipe/TCP + Protobuf JSON (default) Primitive long 1,255,493 10
Pipe/TCP + Protobuf + ZeroCopy MessagePack (typeless) Custom object (serializer path) 1,026,168 10
Pipe/TCP + Protobuf MessagePack (typeless) Custom object (serializer path) 1,019,368 5
DotNetty/TCP + Protobuf JSON (default) Primitive long 971,110 20
DotNetty/TCP + Protobuf MessagePack (typeless) Custom object (serializer path) 948,767 20
Pipe/TCP + Protobuf + ZeroCopy Hyperion Custom object (serializer path) 926,785 15
Pipe/TCP + Protobuf Hyperion Custom object (serializer path) 921,376 15
@to11mtm
to11mtm / PrependableArrayPoolBufferWriter.cs
Last active May 28, 2026 21:37
Example of prependable BufferWriter
#nullable enable
using System;
using System.Buffers;
using System.Buffers.Binary;
namespace Akka.Remote.Transport.Pipelines;
public interface IPrependableBufferWriter : IBufferWriter<byte>, IDisposable
{
Memory<byte> WrittenMemoryRange { get; }
@to11mtm
to11mtm / LmaoWat.md
Created May 9, 2026 04:22
Copilot/Sonnet4.6 Trying so hard and failing

Now I can see the full picture from the new benchmark data. Let me analyze carefully:

• DrainOnly:

100 items: New wins (14.8µs vs 19.4µs) ✅

1000 items, MaxWeight=1: New wins (110µs vs 136µs) ✅

10000 items, MaxWeight=1: New LOSES (651µs vs 342µs) ❌ — 2x

@to11mtm
to11mtm / ChannelBatchQueuePoc.cs
Created March 24, 2026 16:43
Channel with built in eager batching POC.
// -----------------------------------------------------------------------
// <copyright file="ChannelQueueWithBatch.cs" company="Akka.NET Project">
// Copyright (C) 2013-2023 .NET Foundation <https://github.com/akkadotnet/akka.net>
// </copyright>
// -----------------------------------------------------------------------
using System;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
@to11mtm
to11mtm / FlowWithResourceAsync.cs
Last active November 16, 2025 16:53
FlowWithResourceAsync example
using Akka.Annotations;
using Akka.Streams.Dsl;
using Akka.Streams.Implementation.Stages;
using Akka.Streams.Stage;
using Akka.Streams.Supervision;
using Akka.Util;
using Akka.Util.Internal;
namespace Akka.Streams.NATS.KeyValueStore.AkkaStreamsExtensions;
@to11mtm
to11mtm / YouDoNotBelongHere.cs
Last active October 1, 2025 21:34
Abstract Class Funpost
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace derp;
class Program
{
static void Main(string[] args)
{
var obj = new object();
@to11mtm
to11mtm / JetStream.cs
Created September 29, 2025 17:45
Nats Alpakka DSL WIP
using System.Text;
using System.Threading.Tasks.Dataflow;
using Akka;
using Akka.Streams;
using Akka.Streams.Dsl;
using Akka.Streams.Implementation.Fusing;
using Akka.Util;
using JetBrains.Annotations;
using NATS.Client.Core;
using NATS.Client.JetStream;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Linq2Db.EfCore.Samples.Tests.Microsoft.EntityFrameworkCore.Infrastructure;
using LinqToDB.Data;
using LinqToDB.EntityFrameworkCore;
using LinqToDB.Mapping;