Skip to content

Commit

Permalink
Remove old Fastenshtein versions from competitive benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
DanHarltey committed Jun 17, 2024
1 parent 35128d1 commit 3afcf08
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void SetUp()
//// });
////}

[Benchmark]
[Benchmark(Baseline = true)]
public void Fastenshtein()
{
var words = _words;
Expand Down Expand Up @@ -58,34 +58,6 @@ public void FastenshteinStatic()
});
}

[Benchmark(Baseline = true)]
public void Fastenshtein_1_0_0_8()
{
var words = _words;
Parallel.For(0, words.Length, i =>
{
var levenshtein = new global::Fastenshtein.Benchmarking.FastenshteinOld.Fastenshtein_1_0_0_8(words[i]);

for (int j = 0; j < words.Length; j++)
{
levenshtein.DistanceFrom(words[j]);
}
});
}

[Benchmark]
public void FastenshteinStatic_1_0_0_8()
{
var words = _words;
Parallel.For(0, words.Length, i =>
{
for (int j = 0; j < words.Length; j++)
{
global::Fastenshtein.Benchmarking.FastenshteinOld.Fastenshtein_1_0_0_8.Distance(words[i], words[j]);
}
});
}

[Benchmark]
public void StringSimilarity()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public abstract class CompetitiveSingleThreadBenchmark
protected abstract string[] CreateTestData();

[GlobalSetup]
public void SetUp()
public void SetUp()
=> _words = CreateTestData();

/*
Expand All @@ -29,7 +29,7 @@ public void SetUp()
//// }
////}

[Benchmark]
[Benchmark(Baseline = true)]
public void Fastenshtein()
{
var words = _words;
Expand Down Expand Up @@ -57,34 +57,6 @@ public void FastenshteinStatic()
}
}

[Benchmark(Baseline = true)]
public void Fastenshtein_1_0_0_8()
{
var words = _words;
for (int i = 0; i < words.Length; i++)
{
var levenshtein = new global::Fastenshtein.Benchmarking.FastenshteinOld.Fastenshtein_1_0_0_8(words[i]);

for (int j = 0; j < words.Length; j++)
{
levenshtein.DistanceFrom(words[j]);
}
}
}

[Benchmark]
public void FastenshteinStatic_1_0_0_8()
{
var words = _words;
for (int i = 0; i < words.Length; i++)
{
for (int j = 0; j < words.Length; j++)
{
global::Fastenshtein.Benchmarking.FastenshteinOld.Fastenshtein_1_0_0_8.Distance(words[i], words[j]);
}
}
}

[Benchmark]
public void StringSimilarity()
{
Expand Down

0 comments on commit 3afcf08

Please sign in to comment.