Added Lucene.Net.Benchmark + the Collator functionality in Lucene.Net.ICU to .NET Standard and fixed bugs (still have 4 failing tests).
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4cb35e92 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4cb35e92 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4cb35e92 Branch: refs/heads/master Commit: 4cb35e92cdb269f76b1ad3577f8e8d830542cebd Parents: 198e586 Author: Shad Storhaug <s...@shadstorhaug.com> Authored: Fri Aug 4 14:28:16 2017 +0700 Committer: Shad Storhaug <s...@shadstorhaug.com> Committed: Fri Aug 4 19:33:32 2017 +0700 ---------------------------------------------------------------------- Lucene.Net.Portable.sln | 20 ++++++++++ .../Collation/ICUCollationDocValuesField.cs | 3 ++ .../Collation/ICUCollationKeyFilter.cs | 3 ++ .../ICUCollatedTermAttributeImpl.cs | 3 ++ .../ByTask/Feeds/EnwikiContentSource.cs | 28 ++++++------- .../ByTask/Tasks/AnalyzerFactoryTask.cs | 13 +++--- .../ByTask/Tasks/CreateIndexTask.cs | 14 +++++++ .../ByTask/Tasks/TaskSequence.cs | 2 + .../ByTask/Tasks/WriteLineDocTask.cs | 2 +- .../ByTask/Utils/Algorithm.cs | 2 +- .../Lucene.Net.Benchmark.csproj | 2 +- .../Lucene.Net.Benchmark.xproj | 39 ++++++++++++++++++ .../Support/TagSoup/ElementType.cs | 7 ++-- .../Support/TagSoup/PYXWriter.cs | 4 +- .../Support/TagSoup/Parser.cs | 2 +- src/Lucene.Net.Benchmark/project.json | 27 +++++++------ src/Lucene.Net.ICU/project.json | 9 ++++- .../Collation/TestICUCollationKeyAnalyzer.cs | 3 ++ .../ByTask/Feeds/DocMakerTest.cs | 4 +- .../ByTask/Feeds/EnwikiContentSourceTest.cs | 2 +- .../Lucene.Net.Tests.Benchmark.xproj | 42 ++++++++++++++++++++ .../Properties/AssemblyInfo.cs | 17 +------- src/Lucene.Net.Tests.Benchmark/project.json | 18 ++++----- src/Lucene.Net.Tests.ICU/project.json | 8 ++++ 24 files changed, 203 insertions(+), 71 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/Lucene.Net.Portable.sln ---------------------------------------------------------------------- diff --git a/Lucene.Net.Portable.sln b/Lucene.Net.Portable.sln index e94a262..5dbbd51 100644 --- a/Lucene.Net.Portable.sln +++ b/Lucene.Net.Portable.sln @@ -107,6 +107,10 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Analysis.Kuromoj EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Tests.Analysis.Kuromoji", "src\Lucene.Net.Tests.Analysis.Kuromoji\Lucene.Net.Tests.Analysis.Kuromoji.xproj", "{F82F0F31-09E7-48FB-B5FF-F3A84627A307}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Benchmark", "src\Lucene.Net.Benchmark\Lucene.Net.Benchmark.xproj", "{AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Lucene.Net.Tests.Benchmark", "src\Lucene.Net.Tests.Benchmark\Lucene.Net.Tests.Benchmark.xproj", "{5356412F-8FC5-41D3-83C3-807740B06748}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -491,6 +495,22 @@ Global {F82F0F31-09E7-48FB-B5FF-F3A84627A307}.Release|Any CPU.Build.0 = Release|Any CPU {F82F0F31-09E7-48FB-B5FF-F3A84627A307}.Release|x86.ActiveCfg = Release|Any CPU {F82F0F31-09E7-48FB-B5FF-F3A84627A307}.Release|x86.Build.0 = Release|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Debug|x86.ActiveCfg = Debug|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Debug|x86.Build.0 = Debug|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Release|Any CPU.Build.0 = Release|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Release|x86.ActiveCfg = Release|Any CPU + {AFBD39F9-4C9F-4CC2-BF2F-296D7993CA32}.Release|x86.Build.0 = Release|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Debug|x86.ActiveCfg = Debug|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Debug|x86.Build.0 = Debug|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Release|Any CPU.Build.0 = Release|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Release|x86.ActiveCfg = Release|Any CPU + {5356412F-8FC5-41D3-83C3-807740B06748}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs b/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs index bddc095..4217ba4 100644 --- a/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs +++ b/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs @@ -1,4 +1,7 @@ using Icu.Collation; +#if NETSTANDARD +using Icu.ObjectModel; // For SortKey +#endif using Lucene.Net.Documents; using Lucene.Net.Support; using Lucene.Net.Util; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs b/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs index e6c595a..f84acfe 100644 --- a/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs +++ b/src/Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs @@ -1,4 +1,7 @@ using Icu.Collation; +#if NETSTANDARD +using Icu.ObjectModel; // For SortKey +#endif using Lucene.Net.Analysis; using Lucene.Net.Analysis.TokenAttributes; using Lucene.Net.Support; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs b/src/Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs index ac1187e..1fdca92 100644 --- a/src/Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs +++ b/src/Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs @@ -1,4 +1,7 @@ using Icu.Collation; +#if NETSTANDARD +using Icu.ObjectModel; // For SortKey +#endif using Lucene.Net.Analysis.TokenAttributes; using Lucene.Net.Support; using Lucene.Net.Util; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs index 6870b3b..c310c2d 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs @@ -77,14 +77,14 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds { while (tuple == null && nmde == null && !threadDone && !stopped) { - try - { + //try + //{ Monitor.Wait(this); - } - catch (ThreadInterruptedException ie) - { - throw new ThreadInterruptedException(ie.ToString(), ie); - } + //} + //catch (ThreadInterruptedException ie) + //{ + // throw new ThreadInterruptedException(ie.ToString(), ie); + //} } if (tuple != null) { @@ -148,14 +148,14 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds { while (tuple != null && !stopped) { - try - { + //try + //{ Monitor.Wait(this); //wait(); - } - catch (ThreadInterruptedException ie) - { - throw new ThreadInterruptedException(ie.ToString(), ie); - } + //} + //catch (ThreadInterruptedException ie) + //{ + // throw new ThreadInterruptedException(ie.ToString(), ie); + //} } tuple = tmpTuple; Monitor.Pulse(this); //notify(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs index 56b0114..61d1832 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/AnalyzerFactoryTask.cs @@ -6,6 +6,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Reflection; using System.Text.RegularExpressions; namespace Lucene.Net.Benchmarks.ByTask.Tasks @@ -484,15 +485,15 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks DirectoryInfo baseDir = new DirectoryInfo(RunData.Config.Get("work.dir", "work")); ((IResourceLoaderAware)instance).Inform(new FilesystemResourceLoader(baseDir)); } - if (typeof(CharFilterFactory).IsAssignableFrom(clazz)) + if (typeof(CharFilterFactory).GetTypeInfo().IsAssignableFrom(clazz)) { charFilterFactories.Add((CharFilterFactory)instance); } - else if (typeof(TokenizerFactory).IsAssignableFrom(clazz)) + else if (typeof(TokenizerFactory).GetTypeInfo().IsAssignableFrom(clazz)) { tokenizerFactory = (TokenizerFactory)instance; } - else if (typeof(TokenFilterFactory).IsAssignableFrom(clazz)) + else if (typeof(TokenFilterFactory).GetTypeInfo().IsAssignableFrom(clazz)) { tokenFilterFactories.Add((TokenFilterFactory)instance); } @@ -549,15 +550,15 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks } // No dot - use analysis SPI lookup string analysisComponentName = ANALYSIS_COMPONENT_SUFFIX_PATTERN.Replace(className, "", 1); - if (typeof(CharFilterFactory).IsAssignableFrom(expectedType)) + if (typeof(CharFilterFactory).GetTypeInfo().IsAssignableFrom(expectedType)) { return CharFilterFactory.LookupClass(analysisComponentName); } - else if (typeof(TokenizerFactory).IsAssignableFrom(expectedType)) + else if (typeof(TokenizerFactory).GetTypeInfo().IsAssignableFrom(expectedType)) { return TokenizerFactory.LookupClass(analysisComponentName); } - else if (typeof(TokenFilterFactory).IsAssignableFrom(expectedType)) + else if (typeof(TokenFilterFactory).GetTypeInfo().IsAssignableFrom(expectedType)) { return TokenFilterFactory.LookupClass(analysisComponentName); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs index 046ed25..9705c7a 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/CreateIndexTask.cs @@ -110,6 +110,14 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks string mergeScheduler = config.Get("merge.scheduler", "Lucene.Net.Index.ConcurrentMergeScheduler, Lucene.Net"); +#if !FEATURE_CONCURRENTMERGESCHEDULER + // LUCENENET specific - hack to get our TaskMergeScheduler + // when a ConcurrentMergeScheduler is requested. + if (mergeScheduler.Contains(".ConcurrentMergeScheduler,")) + { + mergeScheduler = "Lucene.Net.Index.TaskMergeScheduler, Lucene.Net"; + } +#endif Type mergeSchedulerType = Type.GetType(mergeScheduler); if (mergeSchedulerType == null) { @@ -132,9 +140,15 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks if (mergeScheduler.Equals("Lucene.Net.Index.ConcurrentMergeScheduler")) { +#if FEATURE_CONCURRENTMERGESCHEDULER ConcurrentMergeScheduler cms = (ConcurrentMergeScheduler)iwConf.MergeScheduler; int maxThreadCount = config.Get("concurrent.merge.scheduler.max.thread.count", ConcurrentMergeScheduler.DEFAULT_MAX_THREAD_COUNT); int maxMergeCount = config.Get("concurrent.merge.scheduler.max.merge.count", ConcurrentMergeScheduler.DEFAULT_MAX_MERGE_COUNT); +#else + TaskMergeScheduler cms = (TaskMergeScheduler)iwConf.MergeScheduler; + int maxThreadCount = config.Get("concurrent.merge.scheduler.max.thread.count", 1); + int maxMergeCount = config.Get("concurrent.merge.scheduler.max.merge.count", 2); +#endif cms.SetMaxMergesAndThreads(maxMergeCount, maxThreadCount); } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Tasks/TaskSequence.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/TaskSequence.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/TaskSequence.cs index 9be1b5d..12d91c0 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Tasks/TaskSequence.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/TaskSequence.cs @@ -218,7 +218,9 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks bgTasks = new List<RunBackgroundTask>(); } RunBackgroundTask bgTask = new RunBackgroundTask(task, letChildReport); +#if FEATURE_THREAD_PRIORITY bgTask.Priority = (task.BackgroundDeltaPriority + Thread.CurrentThread.Priority); +#endif bgTask.Start(); bgTasks.Add(bgTask); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs b/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs index f9e7546..269f98f 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Tasks/WriteLineDocTask.cs @@ -127,7 +127,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Tasks else { checkSufficientFields = true; - HashSet<string> sf = new HashSet<string>(suff.Split(new char[] { ',' }).TrimEnd()); + HashSet<string> sf = new HashSet<string>(suff.Split(',').TrimEnd()); for (int i = 0; i < fieldsToWrite.Length; i++) { if (sf.Contains(fieldsToWrite[i])) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs b/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs index 7e6523e..cc54e64 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs @@ -397,7 +397,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Utils private Type LoadType(string assemblyName, string typeName) { - return Assembly.Load(assemblyName).DefinedTypes.FirstOrDefault(t => t.Name == typeName); + return Assembly.Load(new AssemblyName(assemblyName)).GetTypes().FirstOrDefault(t => t.Name == typeName); } public override string ToString() http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj index 2645226..59fc648 100644 --- a/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj +++ b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.csproj @@ -32,7 +32,7 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup> - <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE</DefineConstants> + <DefineConstants>$(DefineConstants);FEATURE_SERIALIZABLE;FEATURE_CONCURRENTMERGESCHEDULER;FEATURE_THREAD_PRIORITY</DefineConstants> </PropertyGroup> <ItemGroup> <Reference Include="System" /> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.xproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.xproj b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.xproj new file mode 100644 index 0000000..ac422c3 --- /dev/null +++ b/src/Lucene.Net.Benchmark/Lucene.Net.Benchmark.xproj @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + + 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. + +--> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + </PropertyGroup> + <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> + <PropertyGroup Label="Globals"> + <ProjectGuid>afbd39f9-4c9f-4cc2-bf2f-296d7993ca32</ProjectGuid> + <RootNamespace>Lucene.Net.Benchmarks</RootNamespace> + <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> + <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup> + <SchemaVersion>2.0</SchemaVersion> + </PropertyGroup> + <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> +</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs index 6d62a2f..0884588 100644 --- a/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs +++ b/src/Lucene.Net.Benchmark/Support/TagSoup/ElementType.cs @@ -11,6 +11,7 @@ // OF ANY KIND, either express or implied; not even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +using Lucene.Net.Support; using Sax.Helpers; using System; using System.Text; @@ -143,7 +144,7 @@ namespace TagSoup { return "http://www.w3.org/XML/1998/namespace"; } - return string.Intern("urn:x-prefix:" + prefix); + return "urn:x-prefix:" + prefix.Intern(); } /// <summary> @@ -158,7 +159,7 @@ namespace TagSoup { return name; } - return string.Intern(name.Substring(colon + 1)); + return name.Substring(colon + 1).Intern(); } /// <summary> @@ -193,7 +194,7 @@ namespace TagSoup int i = atts.GetIndex(name); if (i == -1) { - name = string.Intern(name); + name = name.Intern(); if (type == null) { type = "CDATA"; http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/Support/TagSoup/PYXWriter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/PYXWriter.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/PYXWriter.cs index ff47d0d..45eebfe 100644 --- a/src/Lucene.Net.Benchmark/Support/TagSoup/PYXWriter.cs +++ b/src/Lucene.Net.Benchmark/Support/TagSoup/PYXWriter.cs @@ -73,7 +73,7 @@ namespace TagSoup public void EOF(char[] buff, int offset, int length) { - theWriter.Close(); + theWriter.Dispose(); } public void ETag(char[] buff, int offset, int length) @@ -177,7 +177,7 @@ namespace TagSoup public void EndDocument() { - theWriter.Close(); + theWriter.Dispose(); } public void EndElement(string uri, string localname, string qname) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs index a0a5463..e353b85 100644 --- a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs +++ b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs @@ -542,7 +542,7 @@ namespace TagSoup /// <returns></returns> private Stream GetInputStream(string publicid, string systemid) { - var basis = new Uri("file://" + Environment.CurrentDirectory + Path.DirectorySeparatorChar); + var basis = new Uri("file://" + Directory.GetCurrentDirectory() + Path.DirectorySeparatorChar); var url = new Uri(basis, systemid); return new FileStream(url.LocalPath, FileMode.Open, FileAccess.Read, FileShare.Read); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Benchmark/project.json ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Benchmark/project.json b/src/Lucene.Net.Benchmark/project.json index adac6d5..95b896f 100644 --- a/src/Lucene.Net.Benchmark/project.json +++ b/src/Lucene.Net.Benchmark/project.json @@ -18,35 +18,36 @@ "nowarn": [ "1591", "1573" ] }, "dependencies": { - "icu.net": "54.1.1-alpha", + "icu.net": "54.1.1-alpha", "Lucene.Net": "4.8.0", "Lucene.Net.Analysis.Common": "4.8.0", - "Lucene.Net.Facet": "4.8.0", - "Lucene.Net.Highlighter": "4.8.0", - "Lucene.Net.ICU": "4.8.0", - "Lucene.Net.Queries": "4.8.0", - "Lucene.Net.QueryParser": "4.8.0", - "Lucene.Net.Spatial": "4.8.0", - "Sax.Net": "2.0.2", - "SharpZipLib": "0.86.0", - "Spatial4n.Core": "0.4.1-beta00003", - "TagSoup.Net": "1.2.1.1" + "Lucene.Net.Facet": "4.8.0", + "Lucene.Net.Highlighter": "4.8.0", + "Lucene.Net.ICU": "4.8.0", + "Lucene.Net.Queries": "4.8.0", + "Lucene.Net.QueryParser": "4.8.0", + "Lucene.Net.Spatial": "4.8.0", + "Spatial4n.Core": "0.4.1-beta00003" }, "frameworks": { "netstandard1.5": { - "imports": "dnxcore50", + "imports": [ "dnxcore50", "portable-net403+sl5+win8+wp8+wpa81" ], "buildOptions": { "debugType": "portable", "define": [ "NETSTANDARD" ] }, "dependencies": { - "NETStandard.Library": "1.6.0" + "NETStandard.Library": "1.6.0", + "SharpZipLib.NETStandard": "0.86.0.1" } }, "net451": { "buildOptions": { "debugType": "full", "define": [ "FEATURE_SERIALIZABLE" ] + }, + "dependencies": { + "SharpZipLib": "0.86.0" } } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.ICU/project.json ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.ICU/project.json b/src/Lucene.Net.ICU/project.json index f075fc7..9d718b6 100644 --- a/src/Lucene.Net.ICU/project.json +++ b/src/Lucene.Net.ICU/project.json @@ -24,6 +24,12 @@ "../Lucene.Net.Analysis.Common/Analysis/Th/ThaiWordFilterFactory.cs", "../Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs", "../Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs", + "../Lucene.Net.Analysis.ICU/Collation/ICUCollationAttributeFactory.cs", + "../Lucene.Net.Analysis.ICU/Collation/ICUCollationDocValuesField.cs", + "../Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyAnalyzer.cs", + "../Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilter.cs", + "../Lucene.Net.Analysis.ICU/Collation/ICUCollationKeyFilterFactory.cs", + "../Lucene.Net.Analysis.ICU/Collation/TokenAttributes/ICUCollatedTermAttributeImpl.cs", "../Lucene.Net.Highlighter/PostingsHighlight/DefaultPassageFormatter.cs", "../Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs", "../Lucene.Net.Highlighter/PostingsHighlight/Passage.cs", @@ -53,7 +59,8 @@ "define": [ "NETSTANDARD" ] }, "dependencies": { - "NETStandard.Library": "1.6.0" + "NETStandard.Library": "1.6.0", + "System.Globalization": "4.3.0" } }, "net451": { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs index 55b0b3b..1edc777 100644 --- a/src/Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs +++ b/src/Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs @@ -85,6 +85,9 @@ namespace Lucene.Net.Collation [Test] public void TestThreadSafe() { +#if NETSTANDARD + fail("LUCENENET TODO: Fatal crash on NETSTANDARD"); +#endif int iters = 20 * RANDOM_MULTIPLIER; for (int i = 0; i < iters; i++) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/DocMakerTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/DocMakerTest.cs b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/DocMakerTest.cs index 301c807..e919fb1 100644 --- a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/DocMakerTest.cs +++ b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/DocMakerTest.cs @@ -103,11 +103,11 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds props["directory"] = "RAMDirectory"; if (setNormsProp) { - props["doc.tokenized.norms"] = normsPropVal.ToString(CultureInfo.InvariantCulture); + props["doc.tokenized.norms"] = normsPropVal.ToString(); } if (setBodyNormsProp) { - props["doc.body.tokenized.norms"] = bodyNormsVal.ToString(CultureInfo.InvariantCulture); + props["doc.body.tokenized.norms"] = bodyNormsVal.ToString(); } // Create PerfRunData http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs index 220d75e..310a88c 100644 --- a/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs +++ b/src/Lucene.Net.Tests.Benchmark/ByTask/Feeds/EnwikiContentSourceTest.cs @@ -131,7 +131,7 @@ namespace Lucene.Net.Benchmarks.ByTask.Feeds Dictionary<string, string> props = new Dictionary<string, string>(); props["print.props"] = "false"; - props["content.source.forever"] = forever.ToString(CultureInfo.InvariantCulture); + props["content.source.forever"] = forever.ToString(); Config config = new Config(props); EnwikiContentSource source = new StringableEnwikiSource(docs); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.xproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.xproj b/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.xproj new file mode 100644 index 0000000..4b6c842 --- /dev/null +++ b/src/Lucene.Net.Tests.Benchmark/Lucene.Net.Tests.Benchmark.xproj @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + + 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. + +--> +<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> + <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> + </PropertyGroup> + <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" /> + <PropertyGroup Label="Globals"> + <ProjectGuid>5356412f-8fc5-41d3-83c3-807740b06748</ProjectGuid> + <RootNamespace>Lucene.Net.Benchmarks</RootNamespace> + <BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath> + <OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath> + <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> + </PropertyGroup> + <PropertyGroup> + <SchemaVersion>2.0</SchemaVersion> + </PropertyGroup> + <ItemGroup> + <Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" /> + </ItemGroup> + <Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" /> +</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Benchmark/Properties/AssemblyInfo.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Benchmark/Properties/AssemblyInfo.cs b/src/Lucene.Net.Tests.Benchmark/Properties/AssemblyInfo.cs index 2e12258..2c61f0c 100644 --- a/src/Lucene.Net.Tests.Benchmark/Properties/AssemblyInfo.cs +++ b/src/Lucene.Net.Tests.Benchmark/Properties/AssemblyInfo.cs @@ -8,10 +8,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyTitle("Lucene.Net.Tests.Benchmark")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Lucene.Net.Tests.Benchmark")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible @@ -22,15 +18,4 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9257f543-44e2-4db6-8b27-a8a354c13e5b")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +// NOTE: Version information is in CommonAssemblyInfo.cs http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.Benchmark/project.json ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Benchmark/project.json b/src/Lucene.Net.Tests.Benchmark/project.json index 5babcd7..e4c79ab 100644 --- a/src/Lucene.Net.Tests.Benchmark/project.json +++ b/src/Lucene.Net.Tests.Benchmark/project.json @@ -9,21 +9,21 @@ "includeFiles": [ "ByTask/Feeds/trecdocs.zip", "ByTask/conf.zip", - "ByTask/reuters.first20.lines.txt", - "ByTask/test-mapping-ISOLatin1Accent-partial.txt", + "ByTask/reuters.first20.lines.txt", + "ByTask/test-mapping-ISOLatin1Accent-partial.txt", "Quality/reuters.578.lines.txt.bz2", - "Quality/trecQRels.txt", - "Quality/trecTopics.txt" + "Quality/trecQRels.txt", + "Quality/trecTopics.txt" ] } }, "dependencies": { "dotnet-test-nunit-teamcity": "3.4.0-beta-3", - "icu.net": "54.1.1-alpha", - "Lucene.Net.Analysis.Common": "4.8.0", - "Lucene.Net.Benchmark": "4.8.0", + "icu.net": "54.1.1-alpha", + "Lucene.Net.Analysis.Common": "4.8.0", + "Lucene.Net.Benchmark": "4.8.0", "Lucene.Net.Facet": "4.8.0", - "Lucene.Net.Highlighter": "4.8.0", + "Lucene.Net.Highlighter": "4.8.0", "Lucene.Net.ICU": "4.8.0", "Lucene.Net.TestFramework": "4.8.0", "NUnit": "3.5.0" @@ -31,7 +31,7 @@ "testRunner": "nunit-teamcity", "frameworks": { "netcoreapp1.0": { - "imports": "dnxcore50", + "imports": [ "dnxcore50", "portable-net403+sl5+win8+wp8+wpa81" ], "buildOptions": { "debugType": "portable", "define": [ "NETSTANDARD" ] http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4cb35e92/src/Lucene.Net.Tests.ICU/project.json ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.ICU/project.json b/src/Lucene.Net.Tests.ICU/project.json index 1c3c0cd..15471b0 100644 --- a/src/Lucene.Net.Tests.ICU/project.json +++ b/src/Lucene.Net.Tests.ICU/project.json @@ -11,6 +11,10 @@ "../Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs", "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs", "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationDocValuesField.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyFilter.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyFilterFactory.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestMultiTermHighlighting.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs", @@ -50,6 +54,10 @@ "../Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs", "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs", "../Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationDocValuesField.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyAnalyzer.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyFilter.cs", + "../Lucene.Net.Tests.Analysis.ICU/Collation/TestICUCollationKeyFilterFactory.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestMultiTermHighlighting.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs", "../Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs",