This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch benchmarkdotnet
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 394304b11173d7617362f7095e3ca3ee630f00e5
Author: Shad Storhaug <[email protected]>
AuthorDate: Sun Aug 16 07:11:06 2020 +0700

    Added benchmarks for facet operations using Lucene.Net.Demo.Facet classes 
as a basis
---
 .../FacetsAssociationsBenchmarks.cs                | 53 ++++++++++++++++++
 .../FacetsDistanceBenchmarks.cs                    | 59 ++++++++++++++++++++
 .../FacetsExpressionAggregationBenchmarks.cs       | 50 +++++++++++++++++
 .../FacetsMultiCategoryListsBenchmarks.cs          | 50 +++++++++++++++++
 .../FacetsRangeBenchmarks.cs                       | 64 ++++++++++++++++++++++
 .../FacetsSimpleBenchmarks.cs                      | 59 ++++++++++++++++++++
 .../FacetsSimpleSortedSetBenchmarks.cs             | 53 ++++++++++++++++++
 .../Lucene.Net.Tests.BenchmarkDotNet.csproj        | 11 ++++
 8 files changed, 399 insertions(+)

diff --git 
a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsAssociationsBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsAssociationsBenchmarks.cs
new file mode 100644
index 000000000..ddad50abc
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsAssociationsBenchmarks.cs
@@ -0,0 +1,53 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsAssociationsBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly AssociationsFacetsExample example = new 
AssociationsFacetsExample();
+
+        [Benchmark]
+        public void RunSumAssociations() => example.RunSumAssociations();
+
+        [Benchmark]
+        public void RunDrillDown() => example.RunDrillDown();
+    }
+}
diff --git a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsDistanceBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsDistanceBenchmarks.cs
new file mode 100644
index 000000000..7933c0658
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsDistanceBenchmarks.cs
@@ -0,0 +1,59 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsDistanceBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly DistanceFacetsExample example = new 
DistanceFacetsExample();
+
+        [GlobalSetup]
+        public void GlobalSetup() => example.Index();
+
+        [GlobalCleanup]
+        public void GlobalTearDown() => example.Dispose();
+
+        [Benchmark]
+        public void Search() => example.Search();
+
+        [Benchmark]
+        public void DrillDown() => 
example.DrillDown(DistanceFacetsExample.TWO_KM);
+    }
+}
diff --git 
a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsExpressionAggregationBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsExpressionAggregationBenchmarks.cs
new file mode 100644
index 000000000..fc845b8e3
--- /dev/null
+++ 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsExpressionAggregationBenchmarks.cs
@@ -0,0 +1,50 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsExpressionAggregationBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Expressions", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly ExpressionAggregationFacetsExample example = 
new ExpressionAggregationFacetsExample();
+
+        [Benchmark]
+        public void RunSearch() => example.RunSearch();
+    }
+}
diff --git 
a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsMultiCategoryListsBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsMultiCategoryListsBenchmarks.cs
new file mode 100644
index 000000000..165ca3c6f
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsMultiCategoryListsBenchmarks.cs
@@ -0,0 +1,50 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsMultiCategoryListsBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly MultiCategoryListsFacetsExample example = new 
MultiCategoryListsFacetsExample();
+
+        [Benchmark]
+        public void RunSearch() => example.RunSearch();
+    }
+}
diff --git a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsRangeBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsRangeBenchmarks.cs
new file mode 100644
index 000000000..b79d3bd0e
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsRangeBenchmarks.cs
@@ -0,0 +1,64 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsRangeBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly RangeFacetsExample example = new 
RangeFacetsExample();
+
+        [GlobalCleanup]
+        public void GlobalTearDown() => example.Dispose();
+
+        [Benchmark]
+        public void Search()
+        {
+            example.Index();
+            example.Search();
+        }
+
+        [Benchmark]
+        public void DrillDown()
+        {
+            example.Index();
+            example.DrillDown(example.PAST_SIX_HOURS);
+        }
+    }
+}
diff --git a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleBenchmarks.cs
new file mode 100644
index 000000000..81c5e1a1a
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleBenchmarks.cs
@@ -0,0 +1,59 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsSimpleBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly SimpleFacetsExample example = new 
SimpleFacetsExample();
+
+        [Benchmark]
+        public void RunFacetOnly() => example.RunFacetOnly();
+
+        [Benchmark]
+        public void RunSearch() => example.RunSearch();
+
+        [Benchmark]
+        public void RunDrillDown() => example.RunDrillDown();
+
+        [Benchmark]
+        public void RunDrillSideways() => example.RunDrillSideways();
+    }
+}
diff --git 
a/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleSortedSetBenchmarks.cs 
b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleSortedSetBenchmarks.cs
new file mode 100644
index 000000000..fde4e662d
--- /dev/null
+++ b/src/Lucene.Net.Tests.BenchmarkDotNet/FacetsSimpleSortedSetBenchmarks.cs
@@ -0,0 +1,53 @@
+using BenchmarkDotNet.Attributes;
+using BenchmarkDotNet.Configs;
+using BenchmarkDotNet.Jobs;
+using Lucene.Net.Demo.Facet;
+
+namespace Lucene.Net.Tests.BenchmarkDotNet
+{
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+
+    [MemoryDiagnoser]
+    [Config(typeof(Config))]
+    public class FacetsSimpleSortedSetBenchmarks
+    {
+        private class Config : ManualConfig
+        {
+            public Config()
+            {
+                var baseJob = Job.MediumRun;
+
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00011").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00011").WithId("4.8.0-beta00011"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00010").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00010").WithId("4.8.0-beta00010"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00009").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00009").WithId("4.8.0-beta00009"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00008").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00008").WithId("4.8.0-beta00008"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00007").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00007").WithId("4.8.0-beta00007"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00006").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00006").WithId("4.8.0-beta00006"));
+                AddJob(baseJob.WithNuGet("Lucene.Net.Analysis.Common", 
"4.8.0-beta00005").WithNuGet("Lucene.Net.Facet", 
"4.8.0-beta00005").WithId("4.8.0-beta00005"));
+            }
+        }
+
+        public static readonly SimpleSortedSetFacetsExample example = new 
SimpleSortedSetFacetsExample();
+
+        [Benchmark]
+        public void RunSearch() => example.RunSearch();
+
+        [Benchmark]
+        public void RunDrillDown() => example.RunDrillDown();
+    }
+}
diff --git 
a/src/Lucene.Net.Tests.BenchmarkDotNet/Lucene.Net.Tests.BenchmarkDotNet.csproj 
b/src/Lucene.Net.Tests.BenchmarkDotNet/Lucene.Net.Tests.BenchmarkDotNet.csproj
index 781c6613e..eafd35045 100644
--- 
a/src/Lucene.Net.Tests.BenchmarkDotNet/Lucene.Net.Tests.BenchmarkDotNet.csproj
+++ 
b/src/Lucene.Net.Tests.BenchmarkDotNet/Lucene.Net.Tests.BenchmarkDotNet.csproj
@@ -3,6 +3,7 @@
   <PropertyGroup>
     <OutputType>Exe</OutputType>
     <TargetFramework>netcoreapp3.1</TargetFramework>
+    <StartupObject>Lucene.Net.Tests.BenchmarkDotNet.Program</StartupObject>
   </PropertyGroup>
 
   <ItemGroup>
@@ -11,7 +12,10 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="J2N" Version="1.0.0-beta-0001" />
     <PackageReference Include="Lucene.Net.Analysis.Common" 
Version="4.8.0-beta00005" />
+    <PackageReference Include="Lucene.Net.Expressions" 
Version="4.8.0-beta00005" />
+    <PackageReference Include="Lucene.Net.Facet" Version="4.8.0-beta00005" />
     <PackageReference Include="Lucene.Net.QueryParser" 
Version="4.8.0-beta00005" />
   </ItemGroup>
   
@@ -19,6 +23,13 @@
     <Compile 
Include="..\Lucene.Net.TestFramework\Support\Randomized\Generators\RandomPicks.cs"
 LinkBase="Util" />
     <Compile 
Include="..\Lucene.Net.TestFramework\Support\Randomized\Generators\RandomInts.cs"
 LinkBase="Util" />
     <Compile 
Include="..\Lucene.Net\Support\ExceptionToNetNumericConventionAttribute.cs" 
LinkBase="Util" />
+    <Compile Include="..\Lucene.Net.Demo\Facet\AssociationsFacetsExample.cs" 
LinkBase="Util" />
+    <Compile Include="..\Lucene.Net.Demo\Facet\DistanceFacetsExample.cs" 
LinkBase="Util" />
+    <Compile 
Include="..\Lucene.Net.Demo\Facet\ExpressionAggregationFacetsExample.cs" 
LinkBase="Util" />
+    <Compile 
Include="..\Lucene.Net.Demo\Facet\MultiCategoryListsFacetsExample.cs" 
LinkBase="Util" />
+    <Compile Include="..\Lucene.Net.Demo\Facet\RangeFacetsExample.cs" 
LinkBase="Util" />
+    <Compile Include="..\Lucene.Net.Demo\Facet\SimpleFacetsExample.cs" 
LinkBase="Util" />
+    <Compile 
Include="..\Lucene.Net.Demo\Facet\SimpleSortedSetFacetsExample.cs" 
LinkBase="Util" />
   </ItemGroup>
 
 </Project>

Reply via email to