Skip to content

Commit c01915e

Browse files
committed
FcsBTreeN.BtnAddFirst(), new examples
1 parent 97f8f5e commit c01915e

File tree

21 files changed

+657
-48
lines changed

21 files changed

+657
-48
lines changed

BtnEnumerator.Core.examples/BtnEnumerator.Core.examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.2" />
9+
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.3" />
1010
</ItemGroup>
1111

1212
</Project>

BtnEnumerator.Core.examples/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Program
2828
static void Main(string[] args)
2929
{
3030
Console.OutputEncoding = System.Text.Encoding.UTF8;
31-
Console.WriteLine("BtnEnumerator.Core11.examples");
32-
Console.WriteLine("-----------------------------");
31+
Console.WriteLine(String.Format("BtnEnumerator.Core11.examples, {0}", (IntPtr.Size == 4) ? "32 bit" : "64 bit"));
32+
Console.WriteLine("-------------------------------------");
3333

3434
uint uiCount = 1;
3535
TestKV btnTest = new TestKV();
@@ -106,7 +106,7 @@ static void Main(string[] args)
106106
btnEn.Dispose();
107107

108108
// ---------- REVERSE ----------
109-
Console.WriteLine("-----------------------------");
109+
Console.WriteLine("-------------------------------------");
110110
// output: 46,45,42,40,38,35,32,30,27,26,25,24,22,20,18,15,13,10,8,7,5,
111111
btnEn = btnTest.GetEnumeratorEx(true);
112112
while (btnEn.MoveNext())
@@ -149,7 +149,7 @@ static void Main(string[] args)
149149
Console.WriteLine();
150150
btnEn.Dispose();
151151

152-
Console.WriteLine("-----------------------------");
152+
Console.WriteLine("-------------------------------------");
153153
Console.WriteLine("Key ENTER press.");
154154
Console.ReadLine();
155155
}

BtnEnumerator.NET.examples/BtnEnumerator.NET.examples.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
</PropertyGroup>
1515
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
16+
<PlatformTarget>x64</PlatformTarget>
1717
<DebugSymbols>true</DebugSymbols>
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
@@ -23,7 +23,7 @@
2323
<WarningLevel>4</WarningLevel>
2424
</PropertyGroup>
2525
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
26+
<PlatformTarget>x64</PlatformTarget>
2727
<DebugType>pdbonly</DebugType>
2828
<Optimize>true</Optimize>
2929
<OutputPath>bin\Release\</OutputPath>
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<PackageReference Include="FriendlyCSharp.Databases">
48-
<Version>1.0.2</Version>
48+
<Version>1.0.3</Version>
4949
</PackageReference>
5050
</ItemGroup>
5151
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

BtnEnumerator.NET.examples/Program.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class Program
2828
static void Main(string[] args)
2929
{
3030
Console.OutputEncoding = System.Text.Encoding.UTF8;
31-
Console.WriteLine("BtnEnumerator.NET452.examples");
32-
Console.WriteLine("-----------------------------");
31+
Console.WriteLine(String.Format("BtnEnumerator.NET452.examples, {0}", (IntPtr.Size == 4) ? "32 bit" : "64 bit"));
32+
Console.WriteLine("-------------------------------------");
3333

3434
uint uiCount = 1;
3535
TestKV btnTest = new TestKV();
@@ -106,7 +106,7 @@ static void Main(string[] args)
106106
btnEn.Dispose();
107107

108108
// ---------- REVERSE ----------
109-
Console.WriteLine("-----------------------------");
109+
Console.WriteLine("-------------------------------------");
110110
// output: 46,45,42,40,38,35,32,30,27,26,25,24,22,20,18,15,13,10,8,7,5,
111111
btnEn = btnTest.GetEnumeratorEx(true);
112112
while (btnEn.MoveNext())
@@ -149,7 +149,7 @@ static void Main(string[] args)
149149
Console.WriteLine();
150150
btnEn.Dispose();
151151

152-
Console.WriteLine("-----------------------------");
152+
Console.WriteLine("-------------------------------------");
153153
Console.WriteLine("Key ENTER press.");
154154
Console.ReadLine();
155155
}

FcsFastBTreeN.Core.benchmark/FcsFastBTreeN.Core.benchmark.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.2" />
9+
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.3" />
1010
</ItemGroup>
1111

1212
</Project>

FcsFastBTreeN.Core.benchmark/Program.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public override int GetHashCode(StructBtn x)
5454
static void Main(string[] args)
5555
{
5656
Console.OutputEncoding = System.Text.Encoding.UTF8;
57-
Console.WriteLine("FcsFastBTreeN.Core11.benchmark");
58-
Console.WriteLine("------------------------------");
57+
Console.WriteLine(String.Format("FcsFastBTreeN.Core11.benchmark, {0}", (IntPtr.Size == 4) ? "32 bit" : "64 bit"));
58+
Console.WriteLine("--------------------------------------");
5959

6060
int iPocetAdd = 0;
6161
Random r = new Random((int)DateTime.Now.Ticks);
@@ -77,7 +77,7 @@ static void Main(string[] args)
7777
long iMemOld = iMem;
7878
//
7979
//
80-
Console.WriteLine("------------------------------");
80+
Console.WriteLine("--------------------------------------");
8181
Console.WriteLine("FcsFastBTreeN");
8282
TestKV btnTest = new TestKV();
8383
var swFcsKV = Stopwatch.StartNew();
@@ -113,7 +113,7 @@ static void Main(string[] args)
113113
Console.WriteLine($"{((double)(swFcsKV.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swFcsKV.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swFcsKV.Elapsed.TotalSeconds,20:N0} IOPS");
114114
//
115115
//
116-
Console.WriteLine("------------------------------");
116+
Console.WriteLine("--------------------------------------");
117117
Console.WriteLine("SortedSet");
118118
SortedSet<StructBtn> sorted = new SortedSet<StructBtn>(Comparer<StructBtn>.Create((a, b) => a.CompareTo(b)));
119119
var swSorted = Stopwatch.StartNew();
@@ -141,7 +141,7 @@ static void Main(string[] args)
141141
Console.WriteLine($"{((double)(swSorted.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swSorted.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swSorted.Elapsed.TotalSeconds,20:N0} IOPS");
142142
//
143143
//
144-
Console.WriteLine("------------------------------");
144+
Console.WriteLine("--------------------------------------");
145145
Console.WriteLine("HashSet");
146146
var hash = new HashSet<StructBtn>(new StructBtnComparer());
147147
var swHash = Stopwatch.StartNew();
@@ -169,7 +169,7 @@ static void Main(string[] args)
169169
Console.WriteLine($"{((double)(swHash.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swSorted.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swHash.Elapsed.TotalSeconds,20:N0} IOPS");
170170
//
171171
//
172-
Console.WriteLine("------------------------------");
172+
Console.WriteLine("--------------------------------------");
173173
Console.WriteLine("Dictionary");
174174
var dic = new Dictionary<int, uint>();
175175
var swDic = Stopwatch.StartNew();
@@ -194,7 +194,7 @@ static void Main(string[] args)
194194
//
195195
iCompareCount = 0;
196196
int iCompareEquals = 0;
197-
Console.WriteLine("------------------------------");
197+
Console.WriteLine("--------------------------------------");
198198
Console.WriteLine("Checking for sorting and matching");
199199
btnTest.BtnFastFirst(out fcsKey2, out fcsValue2, 2);
200200
foreach (StructBtn sortedSet in sorted)
@@ -211,7 +211,7 @@ static void Main(string[] args)
211211
Console.WriteLine($"count SortedSet: {iCompareCount}");
212212
Console.WriteLine($"checking: {iCompareEquals}");
213213

214-
Console.WriteLine("------------------------------");
214+
Console.WriteLine("--------------------------------------");
215215
Console.WriteLine("Key ENTER press.");
216216
Console.ReadLine();
217217
}

FcsFastBTreeN.NET.benchmark/FcsFastBTreeN.NET.benchmark.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
1414
</PropertyGroup>
1515
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16-
<PlatformTarget>AnyCPU</PlatformTarget>
16+
<PlatformTarget>x64</PlatformTarget>
1717
<DebugSymbols>true</DebugSymbols>
1818
<DebugType>full</DebugType>
1919
<Optimize>false</Optimize>
@@ -23,7 +23,7 @@
2323
<WarningLevel>4</WarningLevel>
2424
</PropertyGroup>
2525
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26-
<PlatformTarget>AnyCPU</PlatformTarget>
26+
<PlatformTarget>x64</PlatformTarget>
2727
<DebugType>pdbonly</DebugType>
2828
<Optimize>true</Optimize>
2929
<OutputPath>bin\Release\</OutputPath>
@@ -45,7 +45,7 @@
4545
</ItemGroup>
4646
<ItemGroup>
4747
<PackageReference Include="FriendlyCSharp.Databases">
48-
<Version>1.0.2</Version>
48+
<Version>1.0.3</Version>
4949
</PackageReference>
5050
</ItemGroup>
5151
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

FcsFastBTreeN.NET.benchmark/Program.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public override int GetHashCode(StructBtn x)
5454
static void Main(string[] args)
5555
{
5656
Console.OutputEncoding = System.Text.Encoding.UTF8;
57-
Console.WriteLine("FcsFastBTreeN.NET452.benchmark");
58-
Console.WriteLine("------------------------------");
57+
Console.WriteLine(String.Format("FcsFastBTreeN.NET452.benchmark, {0}", (IntPtr.Size == 4) ? "32 bit" : "64 bit"));
58+
Console.WriteLine("--------------------------------------");
5959

6060
int iPocetAdd = 0;
6161
Random r = new Random((int)DateTime.Now.Ticks);
@@ -77,7 +77,7 @@ static void Main(string[] args)
7777
long iMemOld = iMem;
7878
//
7979
//
80-
Console.WriteLine("------------------------------");
80+
Console.WriteLine("--------------------------------------");
8181
Console.WriteLine("FcsFastBTreeN");
8282
TestKV btnTest = new TestKV();
8383
var swFcsKV = Stopwatch.StartNew();
@@ -113,7 +113,7 @@ static void Main(string[] args)
113113
Console.WriteLine($"{((double)(swFcsKV.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swFcsKV.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swFcsKV.Elapsed.TotalSeconds,20:N0} IOPS");
114114
//
115115
//
116-
Console.WriteLine("------------------------------");
116+
Console.WriteLine("--------------------------------------");
117117
Console.WriteLine("SortedSet");
118118
SortedSet<StructBtn> sorted = new SortedSet<StructBtn>(Comparer<StructBtn>.Create((a, b) => a.CompareTo(b)));
119119
var swSorted = Stopwatch.StartNew();
@@ -141,7 +141,7 @@ static void Main(string[] args)
141141
Console.WriteLine($"{((double)(swSorted.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swSorted.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swSorted.Elapsed.TotalSeconds,20:N0} IOPS");
142142
//
143143
//
144-
Console.WriteLine("------------------------------");
144+
Console.WriteLine("--------------------------------------");
145145
Console.WriteLine("HashSet");
146146
var hash = new HashSet<StructBtn>(new StructBtnComparer());
147147
var swHash = Stopwatch.StartNew();
@@ -169,7 +169,7 @@ static void Main(string[] args)
169169
Console.WriteLine($"{((double)(swHash.Elapsed.TotalMilliseconds * 1000000) / iCompareCount),7:N2} ns [{swSorted.Elapsed.TotalMilliseconds,11} ms | {iCompareCount} ]{iCompareCount / swHash.Elapsed.TotalSeconds,20:N0} IOPS");
170170
//
171171
//
172-
Console.WriteLine("------------------------------");
172+
Console.WriteLine("--------------------------------------");
173173
Console.WriteLine("Dictionary");
174174
var dic = new Dictionary<int, uint>();
175175
var swDic = Stopwatch.StartNew();
@@ -194,7 +194,7 @@ static void Main(string[] args)
194194
//
195195
iCompareCount = 0;
196196
int iCompareEquals = 0;
197-
Console.WriteLine("------------------------------");
197+
Console.WriteLine("--------------------------------------");
198198
Console.WriteLine("Checking for sorting and matching");
199199
btnTest.BtnFastFirst(out fcsKey2, out fcsValue2, 2);
200200
foreach (StructBtn sortedSet in sorted)
@@ -211,7 +211,7 @@ static void Main(string[] args)
211211
Console.WriteLine($"count SortedSet: {iCompareCount}");
212212
Console.WriteLine($"checking: {iCompareEquals}");
213213

214-
Console.WriteLine("------------------------------");
214+
Console.WriteLine("--------------------------------------");
215215
Console.WriteLine("Key ENTER press.");
216216
Console.ReadLine();
217217
}

FcsInmemStream.Core.examples/FcsInmemStream.Core.examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.2" />
17+
<PackageReference Include="FriendlyCSharp.Databases" Version="1.0.3" />
1818
</ItemGroup>
1919

2020
</Project>

FcsInmemStream.Core.examples/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public unsafe struct StructIms
2222
static void Main(string[] args)
2323
{
2424
Console.OutputEncoding = System.Text.Encoding.UTF8;
25-
Console.WriteLine("FcsInmemStream.Core11.examples");
26-
Console.WriteLine("------------------------------");
25+
Console.WriteLine(String.Format("FcsInmemStream.Core11.examples, {0}", (IntPtr.Size == 4) ? "32 bit" : "64 bit"));
26+
Console.WriteLine("--------------------------------------");
2727

2828
int iSizeT = Marshal.SizeOf(default(StructIms));
2929
int iRepeat = 6000;
@@ -126,7 +126,7 @@ static void Main(string[] args)
126126
Console.WriteLine("Read IOPS: {0,13:N0} [{1:N7} s] | count: {2,10:N0}", iID / swX.Elapsed.TotalSeconds, swX.Elapsed.TotalSeconds, iID);
127127
ims.Close();
128128

129-
Console.WriteLine("------------------------------");
129+
Console.WriteLine("--------------------------------------");
130130
Console.WriteLine("Key ENTER press.");
131131
Console.ReadLine();
132132
}

0 commit comments

Comments
 (0)