-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add console app for testinng allocations - reduce allocations in various places - some refactoring and cleanup - bump version
- Loading branch information
Showing
17 changed files
with
450 additions
and
1,660 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-counters": { | ||
"version": "8.0.452401", | ||
"commands": [ | ||
"dotnet-counters" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\FuzzySearchNet\FuzzySearchNet.csproj" /> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System.Text; | ||
using FuzzySearchNet; | ||
|
||
// Console.WriteLine("Press enter to begin"); | ||
// Console.ReadLine(); | ||
|
||
//const string term = "foo"; | ||
const string term2 = "fooo--foo-----fo"; | ||
const string text = "foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--foo-----fo--foo-f--fooo--"; | ||
|
||
var count = 100000; | ||
|
||
var stream = new MemoryStream(Encoding.UTF8.GetBytes(text)); | ||
|
||
Console.WriteLine($"Running fuzzy search with count {count}"); | ||
for (int i = 0; i < count; i++) | ||
{ | ||
|
||
await foreach (var _ in FuzzySearch.FindLevenshteinAsync(term2, stream, new FuzzySearchOptions(3), leaveOpen: true)) | ||
{ | ||
|
||
} | ||
stream.Position = 0; | ||
} | ||
|
||
// for (int i = 0; i < count; i++) | ||
// { | ||
// _ = FuzzySearch.FindLevenshtein(term2, text, new FuzzySearchOptions(3)).ToList(); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,4 @@ | ||
using BenchmarkDotNet.Running; | ||
using FuzzySearchNet.Benchmark; | ||
|
||
var summary = BenchmarkRunner.Run<BenchmarkFuzzySearch>(); | ||
|
||
|
||
|
||
/* | ||
* | ||
| Method | Mean | Error | StdDev | | ||
|----------------- |---------:|----------:|----------:| | ||
| SubstitutionOnly | 4.564 us | 0.0905 us | 0.2551 us | | ||
| Method | Mean | Error | StdDev | | ||
|----------------- |---------:|---------:|---------:| | ||
| SubstitutionOnly | 18.98 us | 0.373 us | 0.510 us | | ||
| Method | Mean | Error | StdDev | | ||
|--------------------------------------- |----------:|----------:|----------:| | ||
| SubstitutionOnlyBufferingShort | 3.704 us | 0.0740 us | 0.0909 us | | ||
| SubstitutionOnlyBufferingLong | 2.818 us | 0.0292 us | 0.0244 us | | ||
| SubstitutionOnlyBufferingLong3distance | 4.396 us | 0.0501 us | 0.0492 us | | ||
| Method | Mean | Error | StdDev | | ||
|--------------------------------------- |---------:|----------:|----------:| | ||
| SubstitutionOnlyBufferingShort | 2.628 us | 0.0389 us | 0.0570 us | | ||
| SubstitutionOnlyBufferingLong | 2.031 us | 0.0404 us | 0.0580 us | | ||
| SubstitutionOnlyBufferingLong3distance | 2.808 us | 0.0548 us | 0.0988 us | | ||
| Method | Mean | Error | StdDev | Median | | ||
|--------------------------------------- |---------:|----------:|----------:|---------:| | ||
| SubstitutionOnlyBufferingShort | 2.434 us | 0.0264 us | 0.0220 us | 2.438 us | | ||
| SubstitutionOnlyBufferingLong | 1.843 us | 0.0366 us | 0.0740 us | 1.810 us | | ||
| SubstitutionOnlyBufferingLong3distance | 2.471 us | 0.0494 us | 0.1105 us | 2.468 us | | ||
| Method | Mean | Error | StdDev | Median | | ||
|--------------------------------------- |---------:|----------:|----------:|---------:| | ||
| SubstitutionOnlyBufferingShort | 2.582 us | 0.0515 us | 0.1233 us | 2.543 us | | ||
| SubstitutionOnlyBufferingLong | 2.053 us | 0.0407 us | 0.0743 us | 2.019 us | | ||
| SubstitutionOnlyBufferingLong3distance | 2.819 us | 0.0559 us | 0.1285 us | 2.782 us | | ||
| Method | Mean | Error | StdDev | Median | | ||
|--------------------------------------- |---------:|----------:|----------:|---------:| | ||
| SubstitutionOnlyBufferingShort | 2.690 us | 0.0536 us | 0.1539 us | 2.720 us | | ||
| SubstitutionOnlyBufferingLong | 2.042 us | 0.0405 us | 0.1074 us | 2.001 us | | ||
| SubstitutionOnlyBufferingLong3distance | 2.824 us | 0.0563 us | 0.1412 us | 2.754 us | | ||
*/ | ||
_ = BenchmarkRunner.Run<BenchmarkFuzzySearch>(); |
Oops, something went wrong.