v4.8.0-beta00010
Pre-release
Pre-release
NightOwl888
released this
19 Jul 08:57
·
1293 commits
to master
since this release
This release contains impactful performance enhancements.
Known Issues
-
The
lucene-cli
tool requires anappsettings.json
file, but none was shipped. Upon runninglucene
on the command line, the following error will be presented:F:\Projects\lucenenet>lucene Unhandled exception. System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional. The physical path is 'C:\Users\shad\.dotnet\tools\.store\lucene-cli\4.8.0-beta00010\lucene-cli\4.8.0-beta00010\tools\netcoreapp3.1\any\appsettings.json'. at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload) at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load() at Microsoft.Extensions.Configuration.ConfigurationRoot..ctor(IList`1 providers) at Microsoft.Extensions.Configuration.ConfigurationBuilder.Build() at Lucene.Net.Cli.Program.Main(String[] args) in D:\a\1\s\src\dotnet\tools\lucene-cli\Program.cs:line 27
Adding a text file named
appsettings.json
to the location specified in the error message with opening and closing brackets will prevent the exception.appsettings.json
{ }
IMPORTANT: There must be at least opening and closing curly brackets in the file, or it won't be parsed as valid JSON.
-
J2N versions prior to version 2.0.0-beta-0012 had an infinite recursion bug on
Xamarin.Android
which caused fatal crashes in Lucene.NET. Upgrading J2N to 2.0.0-beta-0012 or higher will prevent these crashes from occurring.
Change Log
Breaking Changes
- PERFORMANCE:
Lucene.Net.Suggest
: Narrowed return type ofContexts
property fromIEnumerable<BytesRef>
toICollection<BytesRef>
to improve performance for certain operations Lucene.Net.TestFramework.Util.LuceneTestCase
: Refactored to correctly load static fields and converted them into static properties. The names were changed to match the conventions of .NET properties.- #261 PERFORMANCE: Changed to use
BitSet
instead ofBitArray
so we don't have to resort to slow extension methods for certain operations
Bugs
Lucene.Net.Support.Collections::ToString()
: Fixed overloads to write "null" when the collection passed isnull
rather than throw an exception- #267 -
Lucene.Net.Codecs
: Fixed testing condition forBaseTermVectorsFormatTestCase
onTermVectorsReaders
by throwingInvalidOperationException
- #301 - After upgrading NuGet package dependencies for NUnit to 3.12.0, NUnit3TestAdapter to 3.16.1, and Microsoft.NET.Test.Sdk to 16.6.1, several false positives were noted due to invalid try-catch logic in tests
Improvements
- Added missing documentation table of contents links for lucene-cli, Lucene.Net.Demo, Lucene.Net.Queries, Lucene.Net.QueryParser, Lucene.Net.Replicator, Lucene.Net.Sandbox, Lucene.Net.Spatial, and Lucene.Net.Suggest.
- #261 PERFORMANCE: - Removed all calls to
Type.GetTypeInfo()
and call properties/methods on theType
instance directly. - #261 PERFORMANCE: -
Lucene.Net.Util.AttributeSource
: Create built-in attributes directly rather than usingActivator.CreateInstance()
- #261 PERFORMANCE: -
Lucene.Net.Util.AttributeSource
: Optimized creation of string to identify attribute type based on attribute interface name - #295 PERFORMANCE: -
Lucene.Net.TestFramework
: Added overloads ofAssert.AreEqual
for collections where J2N's aggressive mode can be switched off - #295 PERFORMANCE: -
Lucene.Net.TestFramework
: Replaced overloads fromNUnit.Framework.CollectionAssert
with optimized implementations using J2N comparers - #295 PERFORMANCE: -
Lucene.Net.TestFramework
: Compile expensive string concatenation out of the release build by usingSystem.Diagnostics.Debug.Assert
- #295 PERFORMANCE: -
Lucene.Net.Util.Automaton
: FixedState
class to initialize and trim more efficiently.
Fixes the performance ofLucene.Net.Util.Automaton.TestBasicOperations::TestEmptyLanguageConcatenate()
. - #295, #261: PERFORMANCE: - Reduced zero length array allocations
- #295, #261: PERFORMANCE: - Reduced zero length collection allocations
- #295, #261: PERFORMANCE: -
Lucene.Net.TestFramework.Search.RandomSimilarityProvider::ToString()
: UseStringBuilder
for better efficiency - #295, #261: PERFORMANCE: -
Lucene.Net.TestFramework.Util.LuceneTestCase
: Cache codecType and similarityName as strings so they don't have to be regenerated for each test - #295, #261: PERFORMANCE: -
Lucene.Net.TestFramework
: UseAssert.IsFalse()
rather thanAssert.That()
- #295, #261: PERFORMANCE: - Reduced calls to LINQ methods and expressions.
- #295, #261: PERFORMANCE: -
Lucene.Net.Index.Term
: Optimized equality checking - #295, #261: PERFORMANCE: -
Lucene.Net.Util
(BytesRef
+CharsRef
): ImplementedIEquatable<T>
- #295, #261: PERFORMANCE: -
Lucene.Net.Tests.Index.TestDocumentsWriterDeleteQueue
: Updated comparisons to reduce memory allocations - #295, #261: PERFORMANCE: -
Lucene.Net.TestFramework
: ChangedConcurrentMergeSchedulerFactories.Values
to only return theTaskMergeScheduler
rarely, since it is no longer a default setting and is slowing down tests - #295, #261: PERFORMANCE: - Added some aggressive inlining
Lucene.Net.TestFramework
: Added overloads ofAssert.Throws
to supply messagesLucene.Net.TestFramework
: Use theMicrosoft.Extensions.Configuration.EnvironmentVariables
provider instead of our custom one.Lucene.Net.Analysis.Tokenizer
: Allow enabling "asserts" for testingazure-pipelines.yml
: Changed to use pipeline caching instead of build caching for better performanceLucene.Net.Tests
(core) - Rearranged how test projects are split so parallel jobs can process them faster- Fixed up leading whitespace to always use spaces instead of tabs
- Updated NuGet package dependency for J2N to 2.0.0-beta-0008
Lucene.Net.Tests.Analysis.Phonetic.Language.Bm.PhoneticEnginePeformanceTest::Test()
: Changed to useStopwatch
for more accurate timingLucene.Net.Tests
: Changed private/internal member variables to consistently use camelCase instead of PascalCase- SWEEP: Changed all properties to use expression style syntax, reordered to put get before set, and changed all backing field names back to their original without the "_Renamed" suffix
- SWEEP: Removed fully-qualified exceptions and added using directives instead
- PERFORMANCE: Pre-compile and statically cache regular expressions
- PERFORMANCE:
Lucene.Net.Analysis
: Removed unnecessary allocations caused by callingToString()
rather than passing theICharTermAttribute
directly - PERFORMANCE:
Lucene.Net.Analysis.Common
: Slight optimization ofToUpper
andToLower
methods, which are used in several analyzers - SWEEP: Removed .NET Standard 1.x/.NET Core 1.x support from all project files
- SWEEP: Removed unused dependencies for .NET Framework
- PERFORMANCE:
Lucene.Net.Codecs.SimpleText
: Usingdecimal
is 30% faster than usingBigInteger
for addition and subtraction - PERFORMANCE: Applied
Slow
andNightly
attributes where applicable for better testing performance Lucene.Net.TestFramework
: Added logging of system properties to the output of tests- PERFORMANCE:
Lucene.Net.Util.ArrayUtil::GetNaturalComparer<T>()
: Use statically cached singleton instance of comparer - Upgraded NuGet dependency ICU4N to 60.1.0-alpha.351
New Features
Lucene.Net.TestFramework.RandomExtensions
: Added missing overload ofNextInt64(long)
to choose only max upper bound- Added a global Lucene.Net.Diagnostics.Debugging.AssertsEnabled static property that can be used to toggle "asserts" on and off in the release build, similar to how it works in Java. The setting can be injected by end users with the "assert" system property (which is a boolean).
Lucene.Net.TestFramework
: Completed implementation ofNightly
,Weekly
,AwaitsFix
andSlow
attributes