Skip to content

damageboy/shame

Repository files navigation

shame

my stab at knucleotide benchmark

based on the submission by Josh Goldfoot which I started off of...

build

Use dotnet build -c release and friends / VS 2017 / Whatever you like Alternatively, if you wish to publish as a self contained binary, use either: dotnet publish -c release -r linux-x64 for publishing on linux -or- dotnet publish -c release -r win10-x64 for windows

generate sample data

once compiled, the mkdata.exe can be used as such:

cd mkdata
dotnet run 25000000 > knucleotide-input25000000.txt

to generate enough data to start having fun with (namely to generate the same amount of data that was used in the submussion I based this one

running it

./shame < knucleotide-input25000000.txt

or (this works better with profilers of sorts):

./shame knucleotide-input25000000.txt

how / what

This submission does a few things "better", namely:

  • RefDictionary.cs: a hacked up version of the coreclr Dictionary<T,K> with the rough following mods:

    • ref-return based this[TKey key] operator
    • remove the concurrent use detection logic
    • constrain TKey / TValue to implement IEquatable<T>, eliminating EqualityComparer<T>.Default
    • Remove the _version tracking
    • Remove Keys / Values properties of the Dictionary
  • Some more complex / yet more efficient chunking/ordering of the parallelization code that reduces the "straggeler effect" of having one task/thread work on a more complex part of the problem while all other tasks/threads have completed