Skip to content

Commit

Permalink
Change FloatsReaderBench to be floats only
Browse files Browse the repository at this point in the history
  • Loading branch information
nietras committed Nov 16, 2023
1 parent 30962ef commit 7deda38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 33 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ with [detailed benchmarks](#comparison-benchmarks) to prove it.
* **🗑️ Zero allocation** - intelligent and efficient memory management allowing
for zero allocations after warmup incl. supporting use cases of reading or
writing arrays of values (e.g. features) easily without repeated allocations.
* **Thoroughly tested** with great code coverage and focus on testing
edge cases incl. randomized [fuzz testing](https://en.wikipedia.org/wiki/Fuzzing).
* **Thorough tests** - great code coverage and focus on edge case testing
incl. randomized [fuzz testing](https://en.wikipedia.org/wiki/Fuzzing).
* **🌐 Cross-platform** - works on any platform, any architecture supported by
.NET. 100% managed and written in beautiful modern C#.
* **✂️ Trimmable and AOT/NativeAOT compatible** - no problematic reflection or
Expand Down
31 changes: 0 additions & 31 deletions src/Sep.ComparisonBenchmarks/FloatsTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,6 @@ static class FloatsTestData
const int RandomSeed = 42;
public const string GroundTruthColNamePrefix = "GT_";
public const string ResultColNamePrefix = "RE_";
const string SetColName = "Set";
const string FileNameColName = "FileName";
const string DataSplitColName = "DataSplit";
static readonly string[] Sets = new[]
{
"SetAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"SetBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
"SetCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC",
"SetDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD",
};
static readonly string[] DataSplits = new[]
{
"Train",
"Validation",
"Test",
};
static readonly string[] FileNames = GenerateFileNames(new Random(17), 2_000);

internal static string GenerateText(int rows, int featuresCount)
{
Expand Down Expand Up @@ -64,9 +47,6 @@ internal static void Fill(Random random, int rows, int featuresCount, SepWriter
for (var r = 0; r < rows; r++)
{
using var row = writer.NewRow();
row[SetColName].Set(Sets[random.Next(0, Sets.Length)]);
row[FileNameColName].Set(FileNames[random.Next(0, FileNames.Length)]);
row[DataSplitColName].Set(DataSplits[random.Next(0, DataSplits.Length)]);
//row[groundTruthColNames].Set(floatsColValues[(r * 2) % floatsColValues.Length]);
//row[resultColNames].Set(floatsColValues[(r * 2 + 1) % floatsColValues.Length]);
row[groundTruthColNames].Format(Fill(random, values));
Expand All @@ -78,17 +58,6 @@ internal static void Fill(Random random, int rows, int featuresCount, SepWriter
Console.WriteLine($"// {nameof(Fill)} test data {ms,7:F3} ms");
}

static string[] GenerateFileNames(Random random, int count)
{
var fileNames = new string[count];
for (var i = 0; i < fileNames.Length; i++)
{
var fileName = $"{new string((char)('a' + random.Next(0, 'z' - 'a')), random.Next(16, 128))}.png";
fileNames[i] = fileName;
}
return fileNames;
}

static string[][] GenerateFloatsColValues(Random random, int count, int floatsCount)
{
var floatsColValues = new string[count][];
Expand Down

0 comments on commit 7deda38

Please sign in to comment.