-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
663 additions
and
72 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
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
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
using BenchmarkDotNet.Attributes; | ||
using BenchmarkDotNet.Diagnostics.Windows.Configs; | ||
using DataStructures; | ||
using PageManager; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Test.Common; | ||
|
||
namespace UnitBenchmark | ||
{ | ||
[RPlotExporter] | ||
[EtwProfiler(performExtraBenchmarksRun: true)] | ||
public class BTreeInsertPerf | ||
{ | ||
[Params(10_000, 50_000, 100_000, 200_000 /* 500_000, 1_000_000 */)] | ||
public int RowsInTableNumber; | ||
|
||
public enum GenerationStrategy | ||
{ | ||
Seq, | ||
Rev, | ||
Rand, | ||
FromFile, | ||
} | ||
|
||
List<RowHolder> itemsToInsertRand; | ||
|
||
ColumnInfo[] schema = new ColumnInfo[] | ||
{ | ||
new ColumnInfo(ColumnType.Int) | ||
}; | ||
|
||
private List<int> GenerateItems(GenerationStrategy strat, int itemNum) | ||
{ | ||
switch (strat) | ||
{ | ||
case GenerationStrategy.Seq: | ||
return Enumerable.Range(0, itemNum).ToList(); | ||
case GenerationStrategy.Rev: | ||
return Enumerable.Range(0, itemNum).Reverse().ToList(); | ||
case GenerationStrategy.Rand: | ||
Random rnd = new Random(); | ||
return Enumerable.Range(0, itemNum).OrderBy(x => rnd.Next()).Distinct().ToList(); | ||
default: | ||
throw new ArgumentException(); | ||
} | ||
} | ||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
itemsToInsertRand = GenerateItems(GenerationStrategy.Rand, this.RowsInTableNumber).Select(item => | ||
{ | ||
var row = new RowHolder(schema); | ||
row.SetField(0, item); | ||
return row; | ||
}).ToList(); | ||
} | ||
|
||
[Benchmark] | ||
public async Task InsertIntoBTreeSingleIntColumnRandomData() | ||
{ | ||
var pageManager = new PageManager.PageManager(4096, new FifoEvictionPolicy(10000, 5), TestGlobals.DefaultPersistedStream); | ||
using ITransaction tran = new DummyTran(); | ||
|
||
Func<RowHolder, RowHolder, int> comp = (rh1, rh2) => | ||
rh1.GetField<int>(0).CompareTo(rh2.GetField<int>(0)); | ||
|
||
BTreeCollection collection = | ||
new BTreeCollection(pageManager, this.schema, new DummyTran(), comp, 0); | ||
|
||
foreach (var item in this.itemsToInsertRand) | ||
{ | ||
await collection.Add(item, tran); | ||
} | ||
} | ||
} | ||
} |
Binary file added
BIN
+1.19 MB
...ertIntoBTreeSingleIntColumnRandomData(RowsInTableNumber_ 200000)-20211206-191554..etl.new
Binary file not shown.
Binary file added
BIN
+60.1 KB
...toBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=10000-cummean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.7 KB
...toBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=10000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.2 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=10000-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+71.5 KB
...SingleIntColumnRandomData-DefaultJob RowsInTableNumber=10000-timelineSmooth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+64.2 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=100000-cummean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.4 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=100000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66 KB
...BTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=100000-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+74.2 KB
...ingleIntColumnRandomData-DefaultJob RowsInTableNumber=100000-timelineSmooth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.4 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=200000-cummean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.9 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=200000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.9 KB
...BTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=200000-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.7 KB
...ingleIntColumnRandomData-DefaultJob RowsInTableNumber=200000-timelineSmooth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.2 KB
...toBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=50000-cummean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+63.9 KB
...toBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=50000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+75.3 KB
...oBTreeSingleIntColumnRandomData-DefaultJob RowsInTableNumber=50000-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.5 KB
...SingleIntColumnRandomData-DefaultJob RowsInTableNumber=50000-timelineSmooth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+60.4 KB
...rf-InsertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=10000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+56.5 KB
...sertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=10000-facetDensity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.4 KB
...f-InsertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=100000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.1 KB
...ertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=100000-facetDensity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+59 KB
...f-InsertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=200000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.3 KB
...ertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=200000-facetDensity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+61.5 KB
...rf-InsertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=50000-density.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+58.2 KB
...sertIntoBTreeSingleIntColumnRandomData-RowsInTableNumber=50000-facetDensity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+67 KB
...tBenchmark.BTreeInsertPerf-InsertIntoBTreeSingleIntColumnRandomData-cummean.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.6 KB
...tBenchmark.BTreeInsertPerf-InsertIntoBTreeSingleIntColumnRandomData-density.png
Oops, something went wrong.
Binary file added
BIN
+71.6 KB
...hmark.BTreeInsertPerf-InsertIntoBTreeSingleIntColumnRandomData-facetDensity.png
Oops, something went wrong.
Binary file added
BIN
+62.7 KB
...mark.BTreeInsertPerf-InsertIntoBTreeSingleIntColumnRandomData-facetTimeline.png
Oops, something went wrong.
Binary file added
BIN
+63.4 KB
...TreeInsertPerf-InsertIntoBTreeSingleIntColumnRandomData-facetTimelineSmooth.png
Oops, something went wrong.
Binary file added
BIN
+52.5 KB
...ark/BenchmarkDotNet.Artifacts/results/UnitBenchmark.BTreeInsertPerf-barplot.png
Oops, something went wrong.
Binary file added
BIN
+42.8 KB
...ark/BenchmarkDotNet.Artifacts/results/UnitBenchmark.BTreeInsertPerf-boxplot.png
Oops, something went wrong.
Oops, something went wrong.