lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [27/50] [abbrv] lucenenet git commit: SWEEP: Eliminated [Debuggable] attribute and added [MethodImpl(MethodImplOptions.NoInlining)] to each potential match for the StackTraceHelper, which allows tests that use it to work in release mode. Solution provide
Date Sat, 09 Sep 2017 00:31:45 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SortedSetDocValuesWriter.cs b/src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
index 04d7bb5..eed6c52 100644
--- a/src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
+++ b/src/Lucene.Net/Index/SortedSetDocValuesWriter.cs
@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -158,6 +159,7 @@ namespace Lucene.Net.Index
             bytesUsed = newBytesUsed;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state, DocValuesConsumer dvConsumer)
         {
             int maxDoc = state.SegmentInfo.DocCount;
@@ -182,6 +184,7 @@ namespace Lucene.Net.Index
                                       GetOrdCountEnumberable(maxCountPerDoc, ordMap));
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/StoredFieldsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/StoredFieldsConsumer.cs b/src/Lucene.Net/Index/StoredFieldsConsumer.cs
index b7a2cde..660c56d 100644
--- a/src/Lucene.Net/Index/StoredFieldsConsumer.cs
+++ b/src/Lucene.Net/Index/StoredFieldsConsumer.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -21,12 +23,15 @@ namespace Lucene.Net.Index
     {
         public abstract void AddField(int docID, IIndexableField field, FieldInfo fieldInfo);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Flush(SegmentWriteState state);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         public abstract void StartDocument();
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void FinishDocument();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/StoredFieldsProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/StoredFieldsProcessor.cs b/src/Lucene.Net/Index/StoredFieldsProcessor.cs
index 3789e25..57eabd4 100644
--- a/src/Lucene.Net/Index/StoredFieldsProcessor.cs
+++ b/src/Lucene.Net/Index/StoredFieldsProcessor.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -62,6 +63,7 @@ namespace Lucene.Net.Index
             Reset();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state)
         {
             int numDocs = state.SegmentInfo.DocCount;
@@ -107,6 +109,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             Reset();
@@ -133,6 +136,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
             Debug.Assert(docWriter.TestPoint("StoredFieldsWriter.finishDocument start"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TaskMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TaskMergeScheduler.cs b/src/Lucene.Net/Index/TaskMergeScheduler.cs
index 62ea4fc..d6bc935 100644
--- a/src/Lucene.Net/Index/TaskMergeScheduler.cs
+++ b/src/Lucene.Net/Index/TaskMergeScheduler.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
@@ -221,6 +222,7 @@ namespace Lucene.Net.Index
             get { return _mergeThreads.Count(x => x.IsAlive && x.CurrentMerge
!= null); }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
         {
             using (_lock.Write())

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TermVectorsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TermVectorsConsumer.cs b/src/Lucene.Net/Index/TermVectorsConsumer.cs
index 6d9de2d..cbcc6ff 100644
--- a/src/Lucene.Net/Index/TermVectorsConsumer.cs
+++ b/src/Lucene.Net/Index/TermVectorsConsumer.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Support;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -53,6 +54,7 @@ namespace Lucene.Net.Index
         }
 
         // LUCENENE specific - original was internal, but FreqProxTermsWriter requires public
(little point, since both are internal classes)
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(IDictionary<string, TermsHashConsumerPerField> fieldsToFlush,
SegmentWriteState state)
         {
             if (writer != null)
@@ -97,6 +99,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void InitTermVectorsWriter()
         {
             if (writer == null)
@@ -107,6 +110,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument(TermsHash termsHash)
         {
             Debug.Assert(docWriter.TestPoint("TermVectorsTermsWriter.finishDocument start"));
@@ -137,6 +141,7 @@ namespace Lucene.Net.Index
             Debug.Assert(docWriter.TestPoint("TermVectorsTermsWriter.finishDocument end"));
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             hasVectors = false;
@@ -162,6 +167,7 @@ namespace Lucene.Net.Index
             return new TermVectorsConsumerPerField(termsHashPerField, this, fieldInfo);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void AddFieldToFlush(TermVectorsConsumerPerField fieldToFlush)
         {
             if (numVectorFields == perFields.Length)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs b/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs
index d27bed2..2e9bec0 100644
--- a/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs
+++ b/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -147,6 +148,7 @@ namespace Lucene.Net.Index
             return doVectors;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Abort()
         {
         }
@@ -167,6 +169,7 @@ namespace Lucene.Net.Index
             termsWriter.AddFieldToFlush(this);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void FinishDocument()
         {
             Debug.Assert(docState.TestPoint("TermVectorsTermsWriterPerField.finish start"));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TermsHash.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TermsHash.cs b/src/Lucene.Net/Index/TermsHash.cs
index 2d3b93b..609db16 100644
--- a/src/Lucene.Net/Index/TermsHash.cs
+++ b/src/Lucene.Net/Index/TermsHash.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -79,6 +80,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             Reset();
@@ -103,6 +105,7 @@ namespace Lucene.Net.Index
             bytePool.Reset(false, false);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Flush(IDictionary<string, InvertedDocConsumerPerField>
fieldsToFlush, SegmentWriteState state)
         {
             IDictionary<string, TermsHashConsumerPerField> childFields = new Dictionary<string,
TermsHashConsumerPerField>();
@@ -140,6 +143,7 @@ namespace Lucene.Net.Index
             return new TermsHashPerField(docInverterPerField, this, nextTermsHash, fieldInfo);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
             consumer.FinishDocument(this);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TermsHashConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TermsHashConsumer.cs b/src/Lucene.Net/Index/TermsHashConsumer.cs
index 946123d..a7c7e8d 100644
--- a/src/Lucene.Net/Index/TermsHashConsumer.cs
+++ b/src/Lucene.Net/Index/TermsHashConsumer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -21,12 +22,15 @@ namespace Lucene.Net.Index
 
     internal abstract class TermsHashConsumer
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Flush(IDictionary<string, TermsHashConsumerPerField> fieldsToFlush,
SegmentWriteState state);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         internal abstract void StartDocument();
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void FinishDocument(TermsHash termsHash);
 
         public abstract TermsHashConsumerPerField AddField(TermsHashPerField termsHashPerField,
FieldInfo fieldInfo);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TermsHashPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TermsHashPerField.cs b/src/Lucene.Net/Index/TermsHashPerField.cs
index 49f572c..cd5c1df 100644
--- a/src/Lucene.Net/Index/TermsHashPerField.cs
+++ b/src/Lucene.Net/Index/TermsHashPerField.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Analysis.TokenAttributes;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -99,6 +100,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             Reset();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs b/src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs
index e1fb40a..d7f74f4 100644
--- a/src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs
+++ b/src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -38,12 +39,14 @@ namespace Lucene.Net.Index
             second.AddField(docID, field, fieldInfo);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state) // LUCENENET NOTE: original was
internal, but other implementations require public
         {
             first.Flush(state);
             second.Flush(state);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort() // LUCENENET NOTE: original was internal, but other
implementations require public
         {
             try
@@ -68,6 +71,7 @@ namespace Lucene.Net.Index
             second.StartDocument();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
             first.FinishDocument();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Properties/AssemblyInfo.cs b/src/Lucene.Net/Properties/AssemblyInfo.cs
index b9daaaa..f04b339 100644
--- a/src/Lucene.Net/Properties/AssemblyInfo.cs
+++ b/src/Lucene.Net/Properties/AssemblyInfo.cs
@@ -29,11 +29,6 @@ using System.Runtime.CompilerServices;
 
 [assembly: CLSCompliant(true)]
 
-// LUCENENET NOTE: This attribute is required to disable optimizations so the 
-// Lucene.Net.Tests.Index.TestIndexWriterExceptions.TestExceptionsDuringCommit() test
-// can read the stack trace information, otherwise the test fails.
-[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations)]
-
 // for testing
 //[assembly: InternalsVisibleTo("Lucene.Net.Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010075a07ce602f88e"
+
 //                                                         "f263c7db8cb342c58ebd49ecdcc210fac874260b0213fb929ac3dcaf4f5b39744b800f99073eca"
+
@@ -41,9 +36,9 @@ using System.Runtime.CompilerServices;
 //                                                         "08437802fb4f8fb80a05e59f80afb99f4ccd0dfe44065743543c4b053b669509d29d332cd32a0c"
+
 //                                                         "b1e97e84")]
 
-// LUCENENET NOTE: For now it is not possible to use a SNK because we have unmanaged references
in Analysis.Common.
+// LUCENENET NOTE: For now we are not using a strong name key.
 // However, we still need InternalsVisibleTo in order to prevent making everything public
just for the sake of testing.
-// This has broad implications, though because many methods are marked "protected internal",
which means other assemblies
+// This has broad implications because many methods are marked "protected internal", which
means other assemblies
 // must update overridden methods to match.
 [assembly: InternalsVisibleTo("Lucene.Net.Tests")]
 [assembly: InternalsVisibleTo("Lucene.Net.TestFramework")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Search/TopDocs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Search/TopDocs.cs b/src/Lucene.Net/Search/TopDocs.cs
index 55bf088..1cdb5cd 100644
--- a/src/Lucene.Net/Search/TopDocs.cs
+++ b/src/Lucene.Net/Search/TopDocs.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
 using System.Diagnostics.CodeAnalysis;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Search
 {
@@ -250,6 +251,7 @@ namespace Lucene.Net.Search
         /// <para/>
         /// @lucene.experimental
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public static TopDocs Merge(Sort sort, int topN, TopDocs[] shardHits)
         {
             return Merge(sort, 0, topN, shardHits);
@@ -260,6 +262,7 @@ namespace Lucene.Net.Search
         /// on the provided start and size. The return <c>TopDocs</c> will always
have a scoreDocs with length of 
         /// at most <see cref="Util.PriorityQueue{T}.Count"/>.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public static TopDocs Merge(Sort sort, int start, int size, TopDocs[] shardHits)
         {
             Util.PriorityQueue<ShardRef> queue;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/BufferedChecksum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/BufferedChecksum.cs b/src/Lucene.Net/Store/BufferedChecksum.cs
index 6240ce4..b5117e3 100644
--- a/src/Lucene.Net/Store/BufferedChecksum.cs
+++ b/src/Lucene.Net/Store/BufferedChecksum.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Support;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -96,6 +97,7 @@ namespace Lucene.Net.Store
             @in.Reset();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void Flush()
         {
             if (upto > 0)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/BufferedIndexOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/BufferedIndexOutput.cs b/src/Lucene.Net/Store/BufferedIndexOutput.cs
index 5e0bd49..6f3f12d 100644
--- a/src/Lucene.Net/Store/BufferedIndexOutput.cs
+++ b/src/Lucene.Net/Store/BufferedIndexOutput.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Support;
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -119,6 +120,7 @@ namespace Lucene.Net.Store
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush()
         {
             crc.Update(buffer, 0, bufferPosition);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/CompoundFileWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/CompoundFileWriter.cs b/src/Lucene.Net/Store/CompoundFileWriter.cs
index cc2faee..220c06f 100644
--- a/src/Lucene.Net/Store/CompoundFileWriter.cs
+++ b/src/Lucene.Net/Store/CompoundFileWriter.cs
@@ -5,6 +5,7 @@ using System.Diagnostics;
 using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -372,6 +373,7 @@ namespace Lucene.Net.Store
                 this.isSeparate = isSeparate;
             }
 
+            [MethodImpl(MethodImplOptions.NoInlining)]
             public override void Flush()
             {
                 @delegate.Flush();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/IndexOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/IndexOutput.cs b/src/Lucene.Net/Store/IndexOutput.cs
index 0e0bc7b..ef9549f 100644
--- a/src/Lucene.Net/Store/IndexOutput.cs
+++ b/src/Lucene.Net/Store/IndexOutput.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -32,6 +33,7 @@ namespace Lucene.Net.Store
     {
         /// <summary>
         /// Forces any buffered output to be written. </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Flush();
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/RAMOutputStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/RAMOutputStream.cs b/src/Lucene.Net/Store/RAMOutputStream.cs
index db0baba..da9aa7b 100644
--- a/src/Lucene.Net/Store/RAMOutputStream.cs
+++ b/src/Lucene.Net/Store/RAMOutputStream.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -207,6 +208,7 @@ namespace Lucene.Net.Store
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush()
         {
             SetFileLength();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Store/RateLimitedIndexOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/RateLimitedIndexOutput.cs b/src/Lucene.Net/Store/RateLimitedIndexOutput.cs
index c61ba6f..2cf7fff 100644
--- a/src/Lucene.Net/Store/RateLimitedIndexOutput.cs
+++ b/src/Lucene.Net/Store/RateLimitedIndexOutput.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Store
 {
@@ -77,6 +78,7 @@ namespace Lucene.Net.Store
             @delegate.Seek(pos);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush()
         {
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Support/IO/DataOutputStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/IO/DataOutputStream.cs b/src/Lucene.Net/Support/IO/DataOutputStream.cs
index 3680347..325bd68 100644
--- a/src/Lucene.Net/Support/IO/DataOutputStream.cs
+++ b/src/Lucene.Net/Support/IO/DataOutputStream.cs
@@ -3,6 +3,7 @@
 
 using System;
 using System.IO;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Support.IO
 {
@@ -59,6 +60,7 @@ namespace Lucene.Net.Support.IO
             buff = new byte[8];
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void Flush()
         {
             @out.Flush();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs b/src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs
index 1fff1dd..254e767 100644
--- a/src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs
+++ b/src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs
@@ -1,5 +1,6 @@
 ´╗┐using System;
 using System.IO;
+using System.Runtime.CompilerServices;
 #if !NETSTANDARD
 using System.Runtime.Remoting;
 #endif
@@ -102,6 +103,7 @@ namespace Lucene.Net.Support.IO
             return Run(() => textWriter.Equals(obj));
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush()
         {
             Run(() => textWriter.Flush());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Fst/NoOutputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Fst/NoOutputs.cs b/src/Lucene.Net/Util/Fst/NoOutputs.cs
index ec36431..ba96056 100644
--- a/src/Lucene.Net/Util/Fst/NoOutputs.cs
+++ b/src/Lucene.Net/Util/Fst/NoOutputs.cs
@@ -1,4 +1,5 @@
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Fst
 {
@@ -88,6 +89,7 @@ namespace Lucene.Net.Util.Fst
             return NO_OUTPUT;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override object Merge(object first, object second)
         {
             Debug.Assert(first == NO_OUTPUT);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Fst/Outputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Fst/Outputs.cs b/src/Lucene.Net/Util/Fst/Outputs.cs
index 4b5677b..1f92c68 100644
--- a/src/Lucene.Net/Util/Fst/Outputs.cs
+++ b/src/Lucene.Net/Util/Fst/Outputs.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Util.Fst
 {
     /*
@@ -90,6 +92,7 @@ namespace Lucene.Net.Util.Fst
 
         // TODO: maybe make valid(T output) public...?  for asserts
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual T Merge(T first, T second)
         {
             throw new System.NotSupportedException();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Packed/AbstractBlockPackedWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Packed/AbstractBlockPackedWriter.cs b/src/Lucene.Net/Util/Packed/AbstractBlockPackedWriter.cs
index f3405a8..c22ab3f 100644
--- a/src/Lucene.Net/Util/Packed/AbstractBlockPackedWriter.cs
+++ b/src/Lucene.Net/Util/Packed/AbstractBlockPackedWriter.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Packed
 {
@@ -138,6 +139,7 @@ namespace Lucene.Net.Util.Packed
             get { return m_ord; }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         protected abstract void Flush();
 
         protected void WriteValues(int bitsRequired)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Packed/BlockPackedWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Packed/BlockPackedWriter.cs b/src/Lucene.Net/Util/Packed/BlockPackedWriter.cs
index 149c66f..e1666c1 100644
--- a/src/Lucene.Net/Util/Packed/BlockPackedWriter.cs
+++ b/src/Lucene.Net/Util/Packed/BlockPackedWriter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Packed
 {
@@ -67,6 +68,7 @@ namespace Lucene.Net.Util.Packed
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         protected override void Flush()
         {
             Debug.Assert(m_off > 0);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Packed/MonotonicBlockPackedWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Packed/MonotonicBlockPackedWriter.cs b/src/Lucene.Net/Util/Packed/MonotonicBlockPackedWriter.cs
index fb31aa2..1714eef 100644
--- a/src/Lucene.Net/Util/Packed/MonotonicBlockPackedWriter.cs
+++ b/src/Lucene.Net/Util/Packed/MonotonicBlockPackedWriter.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Packed
 {
@@ -70,6 +71,7 @@ namespace Lucene.Net.Util.Packed
             base.Add(l);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         protected override void Flush()
         {
             Debug.Assert(m_off > 0);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Packed/PackedDataOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Packed/PackedDataOutput.cs b/src/Lucene.Net/Util/Packed/PackedDataOutput.cs
index 9f23f32..d18ad90 100644
--- a/src/Lucene.Net/Util/Packed/PackedDataOutput.cs
+++ b/src/Lucene.Net/Util/Packed/PackedDataOutput.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Packed
 {
@@ -71,6 +72,7 @@ namespace Lucene.Net.Util.Packed
         /// <summary>
         /// Flush pending bits to the underlying <see cref="DataOutput"/>.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Flush()
         {
             if (remainingBits < 8)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/Packed/PackedWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/Packed/PackedWriter.cs b/src/Lucene.Net/Util/Packed/PackedWriter.cs
index 4e52033..682557d 100644
--- a/src/Lucene.Net/Util/Packed/PackedWriter.cs
+++ b/src/Lucene.Net/Util/Packed/PackedWriter.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Support;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Packed
 {
@@ -87,6 +88,7 @@ namespace Lucene.Net.Util.Packed
             finished = true;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void Flush()
         {
             encoder.Encode(nextValues, 0, nextBlocks, 0, iterations);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Util/TimSorter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Util/TimSorter.cs b/src/Lucene.Net/Util/TimSorter.cs
index 680edc1..a7bd40e 100644
--- a/src/Lucene.Net/Util/TimSorter.cs
+++ b/src/Lucene.Net/Util/TimSorter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util
 {
@@ -206,6 +207,7 @@ namespace Lucene.Net.Util
             --stackSize;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal virtual void Merge(int lo, int mid, int hi)
         {
             if (Compare(mid - 1, mid) <= 0)


Mime
View raw message