Skip to content

Instantly share code, notes, and snippets.

Paul Westcott manofstick

Block or report user

Report or block manofstick

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chainlinq2.cs
using System;
using System.Linq;
using System.Diagnostics;
namespace ConsoleApplication2
{
class Program
{
const string source = "https://github.com/dwyl/english-words/raw/042fb7abca733b186f150dcce85023048e84705f/words.txt";
const string filename = "lotsofwords.txt";
@manofstick
manofstick / chainlinq1.cs
Created Dec 22, 2018
LinqOptimizer's CartLinq
View chainlinq1.cs
using System;
using System.Diagnostics;
#if manofstick_test_chainlinq
using System.ChainLinq;
#else
using System.Linq;
#endif
class Program
{
View take2.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace ConsoleApp95
{
class Node
{
@manofstick
manofstick / take.cs
Created Nov 22, 2018
An alternative take on things...
View take.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace ConsoleApp95
{
class Node
{
View 5360e.fs
open System
open System.Diagnostics
for i = 1 to 5 do
let data =
let r = Random i
Array.init 2500 (fun _ ->
Seq.init (r.Next 50) (fun _ -> r.Next 3)
|> Set.ofSeq)
@manofstick
manofstick / driver.ps1
Last active Jul 28, 2018
Battle Royale - 3: Batch creation
View driver.ps1
$platforms = @("--platform:x86","--platform:x64")
$conditionals = @("--define:IMMUTABLEDICTIONARY", "")
#$platforms = @("--platform:x86")
#$conditionals = @("")
For ($pIdx=0; $pIdx -lt $platforms.Length; $pIdx++) {
$platform = $platforms[$pIdx]
For ($cIdx=0; $cIdx -lt $conditionals.Length; $cIdx++) {
$conditional = $conditionals[$cidx]
@manofstick
manofstick / driver.ps1
Last active Aug 5, 2018
Battle Royale - 2: Finding elements
View driver.ps1
$platforms = @("--platform:x86","--platform:x64")
$containers = @("", "--define:IMMUTABLESORTEDDICTIONARY")
$types = @("", "--define:FASTCOMPARER")
$orders = @("--define:STRIPES", "--define:RANDOM")
For ($cIdx=0; $cIdx -lt $containers.Length; $cIdx++) {
$container = $containers[$cIdx]
For ($pIdx=0; $pIdx -lt $platforms.Length; $pIdx++) {
$platform = $platforms[$pIdx]
For ($tIdx=0; $tIdx -lt $types.Length; $tIdx++) {
@manofstick
manofstick / driver.ps1
Last active Aug 4, 2018
Battle Royale - 1: Adding elements
View driver.ps1
$platforms = @("--platform:x86","--platform:x64")
$containers = @("", "--define:IMMUTABLESORTEDDICTIONARY")
$types = @("", "--define:FASTCOMPARER")
$orders = @("--define:STRIPES", "--define:RANDOM")
For ($cIdx=0; $cIdx -lt $containers.Length; $cIdx++) {
$container = $containers[$cIdx]
For ($pIdx=0; $pIdx -lt $platforms.Length; $pIdx++) {
$platform = $platforms[$pIdx]
For ($tIdx=0; $tIdx -lt $types.Length; $tIdx++) {
View 5365a.fs
// from https://ayende.com/blog/164865/what-about-f-collections
open System
open System.Diagnostics
let ayende iterations =
let sp = Stopwatch.StartNew ()
let rnd = Random 32
let mutable dic = Map.empty
View 5360d.fs
open System
open System.Diagnostics
open System
let getNextSequential n =
let r = Random 42
let start = r.Next (n*3/2)
fun i -> (start + i) % n
let getNextRandom n =
You can’t perform that action at this time.