Skip to content

Instantly share code, notes, and snippets.

View bent-rasmussen's full-sized avatar

Bent Rasmussen bent-rasmussen

View GitHub Profile
@bent-rasmussen
bent-rasmussen / MailboxProcessorPerformanceReference.fs
Last active September 20, 2020 21:10
MailboxProcessor perfornance test to compare against the high-performance task-and-channel-based version (separate Gist).
// MailboxProcessor test for comparison against the performance-optimized task-and-channel-based actor impl. here:
//
// https://gist.github.com/bent-rasmussen/8152df3c842a06acabe219dd877802d5
//
// Tested in LINQPad (hence Dump method usage).
type Message =
| Incr
| Not of bool * AsyncReplyChannel<bool>
| Counter of AsyncReplyChannel<int>
@bent-rasmussen
bent-rasmussen / Actor.fs
Last active September 12, 2023 04:23
Experimental high performance actor implementation for F# using channel and task computation expression.
// NOTE: import this Nuget package: TaskBuilder.fs (written using 2.1.0)
//
// Tested in LINQPad (hence Dump method usage).
open System
open System.Collections
open System.Collections.Generic
open System.Diagnostics
open System.Linq
open System.Threading
@bent-rasmussen
bent-rasmussen / fs-eff.cs
Last active July 23, 2020 23:07
Experiment: Algebraic (file system) Effects using Eff from Nessos
#nullable enable
async Task Main()
{
// Physical file system interpretation of file system effects
var physicalHandler = new PhysicalFileSystemEffectHandler(@"c:\");
// Run test
await Test().Run(physicalHandler);
}
@bent-rasmussen
bent-rasmussen / git-pull-all.ps1
Last active January 5, 2019 15:23
"git pull" for all git subdirectories
cls
Push-Location
Set-Location E:\Git\ # edit this path for your location or use ./
Write-Host ("git pull on all directories under " + (Resolve-Path .\).Path) -ForegroundColor Cyan
""
Get-ChildItem -Directory -path ./ <# add -Recurse to include all subdirectories recursively #> | ForEach-Object {
if (Test-Path ($_.FullName + "/.git") -PathType Container) {
Write-Host $_.FullName -NoNewline -ForegroundColor Green
Write-Host ">" -NoNewLine -ForegroundColor Gray
Write-Host "git pull" -ForegroundColor White