lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [28/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:46 GMT
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 provided by Vincent Van Den Berghe.


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/4abbd4be
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/4abbd4be
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/4abbd4be

Branch: refs/heads/master
Commit: 4abbd4be4bf65c83562cac5870c802b6e31abf64
Parents: 7e8841a
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Sep 8 20:43:54 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Sep 8 20:43:54 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj        |  4 ++++
 src/Lucene.Net.Facet/DrillDownQuery.cs                |  2 ++
 src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs         |  2 ++
 .../Util/Fst/UpToTwoPositiveIntOutputs.cs             |  2 ++
 .../Codecs/Lucene3x/PreFlexRWPostingsFormat.cs        |  2 ++
 .../Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs     |  2 ++
 .../Store/MockDirectoryWrapper.cs                     | 13 ++++++++-----
 src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs | 12 ++++++++++--
 .../Index/TestConcurrentMergeScheduler.cs             |  5 ++++-
 src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs   |  4 ++++
 .../Index/TestIndexWriterExceptions.cs                | 14 ++++++++++++++
 .../Index/TestIndexWriterOnDiskFull.cs                | 11 +++++++----
 src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs   |  2 ++
 .../Index/TestIndexWriterWithThreads.cs               |  6 +++++-
 .../Index/TestPersistentSnapshotDeletionPolicy.cs     |  5 +++--
 .../Index/TestTaskMergeSchedulerExternal.cs           |  2 ++
 src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs    |  2 ++
 .../Compressing/CompressingStoredFieldsWriter.cs      |  5 +++++
 .../Compressing/CompressingTermVectorsWriter.cs       |  5 +++++
 src/Lucene.Net/Codecs/FieldsConsumer.cs               |  2 ++
 src/Lucene.Net/Codecs/LiveDocsFormat.cs               |  2 ++
 .../Codecs/Lucene40/Lucene40LiveDocsFormat.cs         |  2 ++
 .../Codecs/Lucene40/Lucene40StoredFieldsWriter.cs     |  3 +++
 .../Codecs/Lucene40/Lucene40TermVectorsWriter.cs      |  4 ++++
 src/Lucene.Net/Codecs/PostingsConsumer.cs             |  2 ++
 src/Lucene.Net/Codecs/StoredFieldsWriter.cs           |  4 ++++
 src/Lucene.Net/Codecs/TermVectorsWriter.cs            |  4 ++++
 src/Lucene.Net/Codecs/TermsConsumer.cs                |  2 ++
 src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs   |  4 +++-
 src/Lucene.Net/Index/BinaryDocValuesWriter.cs         |  3 +++
 src/Lucene.Net/Index/BufferedUpdatesStream.cs         |  2 ++
 src/Lucene.Net/Index/ConcurrentMergeScheduler.cs      |  3 +++
 src/Lucene.Net/Index/DocConsumer.cs                   |  5 +++++
 src/Lucene.Net/Index/DocFieldConsumer.cs              |  4 ++++
 src/Lucene.Net/Index/DocFieldConsumerPerField.cs      |  3 +++
 src/Lucene.Net/Index/DocFieldProcessor.cs             |  4 ++++
 src/Lucene.Net/Index/DocInverter.cs                   |  4 ++++
 src/Lucene.Net/Index/DocInverterPerField.cs           |  2 ++
 src/Lucene.Net/Index/DocValuesFieldUpdates.cs         |  2 ++
 src/Lucene.Net/Index/DocValuesProcessor.cs            |  4 ++++
 src/Lucene.Net/Index/DocValuesWriter.cs               |  4 ++++
 src/Lucene.Net/Index/DocumentsWriter.cs               |  2 ++
 src/Lucene.Net/Index/DocumentsWriterPerThread.cs      |  5 +++++
 src/Lucene.Net/Index/FreqProxTermsWriter.cs           |  4 ++++
 src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs   |  3 +++
 src/Lucene.Net/Index/IMergeScheduler.cs               |  2 ++
 src/Lucene.Net/Index/IndexWriter.cs                   |  7 +++++++
 src/Lucene.Net/Index/InvertedDocConsumer.cs           |  4 ++++
 src/Lucene.Net/Index/InvertedDocConsumerPerField.cs   |  3 +++
 src/Lucene.Net/Index/InvertedDocEndConsumer.cs        |  4 ++++
 .../Index/InvertedDocEndConsumerPerField.cs           |  3 +++
 src/Lucene.Net/Index/MergePolicy.cs                   |  2 ++
 src/Lucene.Net/Index/MergeScheduler.cs                |  2 ++
 src/Lucene.Net/Index/NoMergeScheduler.cs              |  3 +++
 src/Lucene.Net/Index/NormsConsumer.cs                 |  4 ++++
 src/Lucene.Net/Index/NormsConsumerPerField.cs         |  3 +++
 src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs  |  2 ++
 src/Lucene.Net/Index/NumericDocValuesWriter.cs        |  3 +++
 .../Index/PersistentSnapshotDeletionPolicy.cs         |  2 ++
 src/Lucene.Net/Index/ReadersAndUpdates.cs             |  4 ++++
 src/Lucene.Net/Index/SegmentInfos.cs                  |  5 +++++
 src/Lucene.Net/Index/SegmentMerger.cs                 |  3 +++
 src/Lucene.Net/Index/SerialMergeScheduler.cs          |  3 +++
 src/Lucene.Net/Index/SortedDocValuesWriter.cs         |  3 +++
 src/Lucene.Net/Index/SortedSetDocValuesWriter.cs      |  3 +++
 src/Lucene.Net/Index/StoredFieldsConsumer.cs          |  5 +++++
 src/Lucene.Net/Index/StoredFieldsProcessor.cs         |  4 ++++
 src/Lucene.Net/Index/TaskMergeScheduler.cs            |  2 ++
 src/Lucene.Net/Index/TermVectorsConsumer.cs           |  6 ++++++
 src/Lucene.Net/Index/TermVectorsConsumerPerField.cs   |  3 +++
 src/Lucene.Net/Index/TermsHash.cs                     |  4 ++++
 src/Lucene.Net/Index/TermsHashConsumer.cs             |  4 ++++
 src/Lucene.Net/Index/TermsHashPerField.cs             |  2 ++
 src/Lucene.Net/Index/TwoStoredFieldsConsumers.cs      |  4 ++++
 src/Lucene.Net/Properties/AssemblyInfo.cs             |  9 ++-------
 src/Lucene.Net/Search/TopDocs.cs                      |  3 +++
 src/Lucene.Net/Store/BufferedChecksum.cs              |  2 ++
 src/Lucene.Net/Store/BufferedIndexOutput.cs           |  2 ++
 src/Lucene.Net/Store/CompoundFileWriter.cs            |  2 ++
 src/Lucene.Net/Store/IndexOutput.cs                   |  2 ++
 src/Lucene.Net/Store/RAMOutputStream.cs               |  2 ++
 src/Lucene.Net/Store/RateLimitedIndexOutput.cs        |  2 ++
 src/Lucene.Net/Support/IO/DataOutputStream.cs         |  2 ++
 src/Lucene.Net/Support/IO/SafeTextWriterWrapper.cs    |  2 ++
 src/Lucene.Net/Util/Fst/NoOutputs.cs                  |  2 ++
 src/Lucene.Net/Util/Fst/Outputs.cs                    |  3 +++
 .../Util/Packed/AbstractBlockPackedWriter.cs          |  2 ++
 src/Lucene.Net/Util/Packed/BlockPackedWriter.cs       |  2 ++
 .../Util/Packed/MonotonicBlockPackedWriter.cs         |  2 ++
 src/Lucene.Net/Util/Packed/PackedDataOutput.cs        |  2 ++
 src/Lucene.Net/Util/Packed/PackedWriter.cs            |  2 ++
 src/Lucene.Net/Util/TimSorter.cs                      |  2 ++
 92 files changed, 304 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
index 369e4ab..d59aef4 100644
--- a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
+++ b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
@@ -56,6 +56,10 @@
     <DebugType>portable</DebugType>
   </PropertyGroup>-->
 
+  <ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
+  </ItemGroup>
+
   <PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.5' ">
     <DebugType>portable</DebugType>
   </PropertyGroup>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Facet/DrillDownQuery.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Facet/DrillDownQuery.cs b/src/Lucene.Net.Facet/DrillDownQuery.cs
index 7f93ff0..c300c88 100644
--- a/src/Lucene.Net.Facet/DrillDownQuery.cs
+++ b/src/Lucene.Net.Facet/DrillDownQuery.cs
@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Facet
 {
@@ -142,6 +143,7 @@ namespace Lucene.Net.Facet
         /// Merges (ORs) a new path into an existing AND'd
         /// clause. 
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void Merge(string dim, string[] path)
         {
             int index = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs b/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
index 27ca0f3..cffd774 100644
--- a/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
+++ b/src/Lucene.Net.Misc/Util/Fst/ListOfOutputs.cs
@@ -2,6 +2,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 using System.Text;
 
 namespace Lucene.Net.Util.Fst
@@ -183,6 +184,7 @@ namespace Lucene.Net.Util.Fst
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override object Merge(object first, object second)
         {
             List<T> outputList = new List<T>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs b/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
index d4442ee..90a2263 100644
--- a/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
+++ b/src/Lucene.Net.Misc/Util/Fst/UpToTwoPositiveIntOutputs.cs
@@ -1,6 +1,7 @@
 ´╗┐using Lucene.Net.Store;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Util.Fst
 {
@@ -293,6 +294,7 @@ namespace Lucene.Net.Util.Fst
             return output.ToString();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override object Merge(object first, object second)
         {
             Debug.Assert(Valid(first, false));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWPostingsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWPostingsFormat.cs
index 94886a0..4660593 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWPostingsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWPostingsFormat.cs
@@ -72,6 +72,8 @@ namespace Lucene.Net.Codecs.Lucene3x
                     // we are part of a "merge", we must sort by UTF16:
                     bool unicodeSortOrder = true;
 
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     if (Util.StackTraceHelper.DoesStackTraceContainMethod("Merge"))
                     {
                         unicodeSortOrder = false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs
index 871ee07..143c002 100644
--- a/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs
+++ b/src/Lucene.Net.TestFramework/Codecs/Lucene3x/PreFlexRWTermVectorsFormat.cs
@@ -57,6 +57,8 @@ namespace Lucene.Net.Codecs.Lucene3x
                 // we are part of a "merge", we must sort by UTF16:
                 bool unicodeSortOrder = true;
 
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 if (Util.StackTraceHelper.DoesStackTraceContainMethod("Merge"))
                 {
                         unicodeSortOrder = false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
index d70a853..4da955c 100644
--- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
@@ -1,17 +1,17 @@
-using System.Collections.Concurrent;
+using Lucene.Net.Randomized.Generators;
+using Lucene.Net.Support;
 using NUnit.Framework;
 using System;
+using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.IO;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using System.Threading;
 
 namespace Lucene.Net.Store
 {
-    using Lucene.Net.Randomized.Generators;
-    using Lucene.Net.Support;
-    using System.IO;
-
     /*
          * Licensed to the Apache Software Foundation (ASF) under one or more
          * contributor license agreements.  See the NOTICE file distributed with
@@ -229,6 +229,7 @@ namespace Lucene.Net.Store
             return @delegate is NRTCachingDirectory;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Sync(ICollection<string> names)
         {
             lock (this)
@@ -536,6 +537,7 @@ namespace Lucene.Net.Store
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void DeleteFile(string name)
         {
             lock (this)
@@ -581,6 +583,7 @@ namespace Lucene.Net.Store
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void DeleteFile(string name, bool forced)
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs b/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
index caa7387..476f899 100644
--- a/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
+++ b/src/Lucene.Net.TestFramework/Util/StackTraceHelper.cs
@@ -32,10 +32,13 @@ namespace Lucene.Net.Util
 {
     public static class StackTraceHelper
     {
-        private static Regex s_methodNameRegex = new Regex(@"at\s+(?<fullyQualifiedMethod>.*\.(?<method>[\w`]+))\(");
+        private static readonly Regex METHOD_NAME_REGEX = new Regex(@"at\s+(?<fullyQualifiedMethod>.*\.(?<method>[\w`]+))\(");
 
         /// <summary>
         /// Matches the StackTrace for a method name.
+        /// <para/>
+        /// IMPORTANT: To make the tests pass in release mode, the method(s) named here 
+        /// must be decorated with [MethodImpl(MethodImplOptions.NoInlining)].
         /// </summary>
         public static bool DoesStackTraceContainMethod(string methodName)
         {
@@ -58,6 +61,9 @@ namespace Lucene.Net.Util
 
         /// <summary>
         /// Matches the StackTrace for a particular class (not fully-qualified) and method name.
+        /// <para/>
+        /// IMPORTANT: To make the tests pass in release mode, the method(s) named here 
+        /// must be decorated with [MethodImpl(MethodImplOptions.NoInlining)].
         /// </summary>
         public static bool DoesStackTraceContainMethod(string className, string methodName)
         {
@@ -78,6 +84,7 @@ namespace Lucene.Net.Util
 #endif
         }
 
+#if FEATURE_STACKTRACE
         private static IEnumerable<string> GetStackTrace(bool includeFullyQualifiedName)
         {
             var matches =
@@ -85,7 +92,7 @@ namespace Lucene.Net.Util
                 .Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries)
                 .Select(line =>
                 {
-                    var match = s_methodNameRegex.Match(line);
+                    var match = METHOD_NAME_REGEX.Match(line);
 
                     if (!match.Success)
                     {
@@ -100,5 +107,6 @@ namespace Lucene.Net.Util
 
             return matches;
         }
+#endif
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs b/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
index 42df0f6..26ba13b 100644
--- a/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net.Tests/Index/TestConcurrentMergeScheduler.cs
@@ -70,8 +70,11 @@ namespace Lucene.Net.Index
             {
                 if (DoFail && TestThread())
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     bool isDoFlush = Util.StackTraceHelper.DoesStackTraceContainMethod("Flush");
-                    bool isClose = Util.StackTraceHelper.DoesStackTraceContainMethod("Close");    
+                    bool isClose = Util.StackTraceHelper.DoesStackTraceContainMethod("Close") ||
+                        Util.StackTraceHelper.DoesStackTraceContainMethod("Dispose");    
 
                     if (isDoFlush && !isClose && Random().NextBoolean())
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
index fa64b75..6505dcc 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterDelete.cs
@@ -971,6 +971,8 @@ namespace Lucene.Net.Index
                 }
                 if (sawMaybe && !failed)
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     bool seen = 
                         StackTraceHelper.DoesStackTraceContainMethod("ApplyDeletesAndUpdates") ||
                         StackTraceHelper.DoesStackTraceContainMethod("SlowFileExists");                 
@@ -989,6 +991,8 @@ namespace Lucene.Net.Index
                 }
                 if (!failed)
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     if (StackTraceHelper.DoesStackTraceContainMethod("ApplyDeletesAndUpdates"))
                     {
                         if (VERBOSE)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
index 78854cc..61a8f13 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterExceptions.cs
@@ -733,6 +733,8 @@ namespace Lucene.Net.Index
             {
                 if (DoFail)
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     bool sawAppend = StackTraceHelper.DoesStackTraceContainMethod(typeof(FreqProxTermsWriterPerField).Name, "Flush");
                     bool sawFlush = StackTraceHelper.DoesStackTraceContainMethod("Flush");
 
@@ -1076,6 +1078,8 @@ namespace Lucene.Net.Index
             {
                 if (DoFail)
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     bool foundMethod =
                         StackTraceHelper.DoesStackTraceContainMethod(typeof(MockDirectoryWrapper).Name, "Sync");
 
@@ -1162,6 +1166,8 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 bool isCommit = StackTraceHelper.DoesStackTraceContainMethod(typeof(SegmentInfos).Name, Stage);
                 bool isDelete = StackTraceHelper.DoesStackTraceContainMethod(typeof(MockDirectoryWrapper).Name, "DeleteFile");
                 bool isInGlobalFieldMap = StackTraceHelper.DoesStackTraceContainMethod(typeof(SegmentInfos).Name, "WriteGlobalFieldMap");
@@ -1699,6 +1705,8 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 bool fail = StackTraceHelper.DoesStackTraceContainMethod(typeof(TermVectorsConsumer).Name, Stage);
 
                 if (fail)
@@ -1870,6 +1878,8 @@ namespace Lucene.Net.Index
 
             public override IndexInput OpenInput(string name, IOContext context)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 if (DoFail
                     && name.StartsWith("segments_", StringComparison.Ordinal)
                     && StackTraceHelper.DoesStackTraceContainMethod("Read"))
@@ -2452,6 +2462,8 @@ namespace Lucene.Net.Index
                     return;
                 }
 
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 bool sawSeal = StackTraceHelper.DoesStackTraceContainMethod("SealFlushedSegment");
                 bool sawWrite = StackTraceHelper.DoesStackTraceContainMethod("WriteLiveDocs")
                         || StackTraceHelper.DoesStackTraceContainMethod("WriteFieldUpdates");
@@ -2652,6 +2664,8 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 bool maybeFail = StackTraceHelper.DoesStackTraceContainMethod("RollbackInternal");
 
                 if (maybeFail && Random().Next(10) == 0)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
index c8c0d24..bbcab14 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterOnDiskFull.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using Lucene.Net.Codecs;
 using Lucene.Net.Documents;
 using Lucene.Net.Support;
 
@@ -568,15 +569,17 @@ namespace Lucene.Net.Index
                     return;
                 }
 
-                /*typeof(SegmentMerger).Name.Equals(frame.GetType().Name) && */
-                if (StackTraceHelper.DoesStackTraceContainMethod("MergeTerms") && !DidFail1)
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
+                if (StackTraceHelper.DoesStackTraceContainMethod(typeof(SegmentMerger).Name, "MergeTerms") && !DidFail1)
                 {
                     DidFail1 = true;
                     throw new IOException("fake disk full during mergeTerms");
                 }
 
-                /*typeof(LiveDocsFormat).Name.Equals(frame.GetType().Name) && */
-                if (StackTraceHelper.DoesStackTraceContainMethod("WriteLiveDocs") && !DidFail2)
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
+                if (StackTraceHelper.DoesStackTraceContainMethod(typeof(LiveDocsFormat).Name, "WriteLiveDocs") && !DidFail2)
                 {
                     DidFail2 = true;
                     throw new IOException("fake disk full while writing LiveDocs");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
index a835d36..bd5a088 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterReader.cs
@@ -1388,6 +1388,8 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 if (ShouldFail.Get() && StackTraceHelper.DoesStackTraceContainMethod("GetReadOnlyClone"))
                 {
                     if (VERBOSE)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs b/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
index 7c6914a..86f6dd0 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexWriterWithThreads.cs
@@ -446,6 +446,8 @@ namespace Lucene.Net.Index
 
                 if (DoFail)
                 {
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                     bool sawAbortOrFlushDoc = StackTraceHelper.DoesStackTraceContainMethod("Abort")
                         || StackTraceHelper.DoesStackTraceContainMethod("FinishDocument");
                     bool sawClose = StackTraceHelper.DoesStackTraceContainMethod("Close")
@@ -512,7 +514,9 @@ namespace Lucene.Net.Index
             {
                 if (DoFail)
                 {
-                    if (StackTraceHelper.DoesStackTraceContainMethod("Flush") /*&& "Lucene.Net.Index.DocFieldProcessor".Equals(frame.GetType().Name)*/)
+                    // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                    // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
+                    if (StackTraceHelper.DoesStackTraceContainMethod(typeof(DocFieldProcessor).Name, "Flush"))
                     {
                         if (OnlyOnce)
                         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
index 661605f..09587f3 100644
--- a/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/Index/TestPersistentSnapshotDeletionPolicy.cs
@@ -167,8 +167,9 @@ namespace Lucene.Net.Index
 
             public override void Eval(MockDirectoryWrapper dir)
             {
-                /*typeof(PersistentSnapshotDeletionPolicy).Name.Equals(frame.GetType().Name) && */
-                if (StackTraceHelper.DoesStackTraceContainMethod("Persist"))
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
+                if (StackTraceHelper.DoesStackTraceContainMethod(typeof(PersistentSnapshotDeletionPolicy).Name, "Persist"))
                 {
                     throw new IOException("now fail on purpose");
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/Index/TestTaskMergeSchedulerExternal.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestTaskMergeSchedulerExternal.cs b/src/Lucene.Net.Tests/Index/TestTaskMergeSchedulerExternal.cs
index 0b3c8ce..42dee2b 100644
--- a/src/Lucene.Net.Tests/Index/TestTaskMergeSchedulerExternal.cs
+++ b/src/Lucene.Net.Tests/Index/TestTaskMergeSchedulerExternal.cs
@@ -73,6 +73,8 @@ namespace Lucene.Net.Tests
         {
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 if (StackTraceHelper.DoesStackTraceContainMethod("DoMerge"))
                 {
                     throw new IOException("now failing during merge");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs b/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs
index ff450ab..69b6d1c 100644
--- a/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs
+++ b/src/Lucene.Net.Tests/TestMergeSchedulerExternal.cs
@@ -102,6 +102,8 @@ namespace Lucene.Net
         {
             public override void Eval(MockDirectoryWrapper dir)
             {
+                // LUCENENET specific: for these to work in release mode, we have added [MethodImpl(MethodImplOptions.NoInlining)]
+                // to each possible target of the StackTraceHelper. If these change, so must the attribute on the target methods.
                 if (StackTraceHelper.DoesStackTraceContainMethod("DoMerge"))
                 {
                     throw new IOException("now failing during merge");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsWriter.cs b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsWriter.cs
index 4d71a2d..3a53c4c 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsWriter.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingStoredFieldsWriter.cs
@@ -8,6 +8,7 @@ using Lucene.Net.Util.Packed;
 using System;
 using System.Diagnostics;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using Document = Lucene.Net.Documents.Document;
 
 namespace Lucene.Net.Codecs.Compressing
@@ -160,6 +161,7 @@ namespace Lucene.Net.Codecs.Compressing
             ++numBufferedDocs;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void FinishDocument()
         {
             endOffsets[numBufferedDocs - 1] = bufferedDocs.Length;
@@ -232,6 +234,7 @@ namespace Lucene.Net.Codecs.Compressing
             return bufferedDocs.Length >= chunkSize || numBufferedDocs >= MAX_DOCUMENTS_PER_CHUNK; // chunks of at least chunkSize bytes
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void Flush()
         {
             indexWriter.WriteIndex(numBufferedDocs, fieldsStream.GetFilePointer());
@@ -354,6 +357,7 @@ namespace Lucene.Net.Codecs.Compressing
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             IOUtils.DisposeWhileHandlingException(this);
@@ -379,6 +383,7 @@ namespace Lucene.Net.Codecs.Compressing
             Debug.Assert(bufferedDocs.Length == 0);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override int Merge(MergeState mergeState)
         {
             int docCount = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
index 8155a9c..f698345 100644
--- a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
+++ b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsWriter.cs
@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using ArrayUtil = Lucene.Net.Util.ArrayUtil;
 
 namespace Lucene.Net.Codecs.Compressing
@@ -306,6 +307,7 @@ namespace Lucene.Net.Codecs.Compressing
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             IOUtils.DisposeWhileHandlingException(this);
@@ -317,6 +319,7 @@ namespace Lucene.Net.Codecs.Compressing
             curDoc = AddDocData(numVectorFields);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void FinishDocument()
         {
             // append the payload bytes of the doc after its terms
@@ -372,6 +375,7 @@ namespace Lucene.Net.Codecs.Compressing
             return termSuffixes.Length >= chunkSize || pendingDocs.Count >= MAX_DOCUMENTS_PER_CHUNK;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void Flush()
         {
             int chunkDocs = pendingDocs.Count;
@@ -863,6 +867,7 @@ namespace Lucene.Net.Codecs.Compressing
             curField.totalPositions += numProx;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override int Merge(MergeState mergeState)
         {
             int docCount = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/FieldsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/FieldsConsumer.cs b/src/Lucene.Net/Codecs/FieldsConsumer.cs
index 8c29e2e..1f906c7 100644
--- a/src/Lucene.Net/Codecs/FieldsConsumer.cs
+++ b/src/Lucene.Net/Codecs/FieldsConsumer.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs
 {
@@ -79,6 +80,7 @@ namespace Lucene.Net.Codecs
         /// <see cref="PostingsFormat"/> can override this default
         /// implementation to do its own merging.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void Merge(MergeState mergeState, Fields fields)
         {
             foreach (string field in fields)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/LiveDocsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/LiveDocsFormat.cs b/src/Lucene.Net/Codecs/LiveDocsFormat.cs
index fb377a6..1a78fdd 100644
--- a/src/Lucene.Net/Codecs/LiveDocsFormat.cs
+++ b/src/Lucene.Net/Codecs/LiveDocsFormat.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs
 {
@@ -57,6 +58,7 @@ namespace Lucene.Net.Codecs
         /// <see cref="SegmentCommitInfo.NextDelGen"/> to determine the
         /// generation of the deletes file you should write to.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void WriteLiveDocs(IMutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context);
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/Lucene40/Lucene40LiveDocsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene40/Lucene40LiveDocsFormat.cs b/src/Lucene.Net/Codecs/Lucene40/Lucene40LiveDocsFormat.cs
index f26406e..fd0efe5 100644
--- a/src/Lucene.Net/Codecs/Lucene40/Lucene40LiveDocsFormat.cs
+++ b/src/Lucene.Net/Codecs/Lucene40/Lucene40LiveDocsFormat.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs.Lucene40
 {
@@ -96,6 +97,7 @@ namespace Lucene.Net.Codecs.Lucene40
             return liveDocs;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void WriteLiveDocs(IMutableBits bits, Directory dir, SegmentCommitInfo info, int newDelCount, IOContext context)
         {
             string filename = IndexFileNames.FileNameFromGeneration(info.Info.Name, DELETES_EXTENSION, info.NextDelGen);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs b/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
index 81787be..2239f7e 100644
--- a/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
+++ b/src/Lucene.Net/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Documents;
 using Lucene.Net.Support;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs.Lucene40
 {
@@ -139,6 +140,7 @@ namespace Lucene.Net.Codecs.Lucene40
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             try
@@ -276,6 +278,7 @@ namespace Lucene.Net.Codecs.Lucene40
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override int Merge(MergeState mergeState)
         {
             int docCount = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/Lucene40/Lucene40TermVectorsWriter.cs b/src/Lucene.Net/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
index 9ff8537..b8107e5 100644
--- a/src/Lucene.Net/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
+++ b/src/Lucene.Net/Codecs/Lucene40/Lucene40TermVectorsWriter.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.Codecs.Lucene40
 {
@@ -134,6 +135,7 @@ namespace Lucene.Net.Codecs.Lucene40
             tvf.WriteByte((byte)bits);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void FinishDocument()
         {
             Debug.Assert(fieldCount == numVectorFields);
@@ -316,6 +318,7 @@ namespace Lucene.Net.Codecs.Lucene40
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             try
@@ -357,6 +360,7 @@ namespace Lucene.Net.Codecs.Lucene40
             Debug.Assert(tvf.GetFilePointer() == tvfPosition);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override int Merge(MergeState mergeState)
         {
             // Used for bulk-reading raw bytes for term vectors

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/PostingsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/PostingsConsumer.cs b/src/Lucene.Net/Codecs/PostingsConsumer.cs
index c4dedfc..93588a9 100644
--- a/src/Lucene.Net/Codecs/PostingsConsumer.cs
+++ b/src/Lucene.Net/Codecs/PostingsConsumer.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Index;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs
 {
@@ -84,6 +85,7 @@ namespace Lucene.Net.Codecs
         /// Default merge impl: append documents, mapping around
         /// deletes.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual TermStats Merge(MergeState mergeState, IndexOptions indexOptions, DocsEnum postings, FixedBitSet visitedDocs)
         {
             int df = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/StoredFieldsWriter.cs b/src/Lucene.Net/Codecs/StoredFieldsWriter.cs
index 130cfc1..bc5b847 100644
--- a/src/Lucene.Net/Codecs/StoredFieldsWriter.cs
+++ b/src/Lucene.Net/Codecs/StoredFieldsWriter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs
 {
@@ -64,6 +65,7 @@ namespace Lucene.Net.Codecs
 
         /// <summary>
         /// Called when a document and all its fields have been added. </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void FinishDocument()
         {
         }
@@ -76,6 +78,7 @@ namespace Lucene.Net.Codecs
         /// Aborts writing entirely, implementation should remove
         /// any partially-written files, etc.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         /// <summary>
@@ -97,6 +100,7 @@ namespace Lucene.Net.Codecs
         /// Implementations can override this method for more sophisticated
         /// merging (bulk-byte copying, etc).
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual int Merge(MergeState mergeState)
         {
             int docCount = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/TermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/TermVectorsWriter.cs b/src/Lucene.Net/Codecs/TermVectorsWriter.cs
index 9d91956..fc2132d 100644
--- a/src/Lucene.Net/Codecs/TermVectorsWriter.cs
+++ b/src/Lucene.Net/Codecs/TermVectorsWriter.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.Codecs
 {
@@ -79,6 +80,7 @@ namespace Lucene.Net.Codecs
 
         /// <summary>
         /// Called after a doc and all its fields have been added. </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void FinishDocument()
         {
         }
@@ -117,6 +119,7 @@ namespace Lucene.Net.Codecs
         /// Aborts writing entirely, implementation should remove
         /// any partially-written files, etc.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         /// <summary>
@@ -216,6 +219,7 @@ namespace Lucene.Net.Codecs
         /// Implementations can override this method for more sophisticated
         /// merging (bulk-byte copying, etc).
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual int Merge(MergeState mergeState)
         {
             int docCount = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Codecs/TermsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Codecs/TermsConsumer.cs b/src/Lucene.Net/Codecs/TermsConsumer.cs
index 2789ef1..b731f01 100644
--- a/src/Lucene.Net/Codecs/TermsConsumer.cs
+++ b/src/Lucene.Net/Codecs/TermsConsumer.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Index;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Codecs
 {
@@ -95,6 +96,7 @@ namespace Lucene.Net.Codecs
 
         /// <summary>
         /// Default merge impl. </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void Merge(MergeState mergeState, IndexOptions indexOptions, TermsEnum termsEnum)
         {
             BytesRef term;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs b/src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs
index 43357b0..e4f51d1 100644
--- a/src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs
+++ b/src/Lucene.Net/Index/BinaryDocValuesFieldUpdates.cs
@@ -1,5 +1,6 @@
-using System;
 using Lucene.Net.Documents;
+using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -244,6 +245,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(DocValuesFieldUpdates other)
         {
             BinaryDocValuesFieldUpdates otherUpdates = (BinaryDocValuesFieldUpdates)other;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/BinaryDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/BinaryDocValuesWriter.cs b/src/Lucene.Net/Index/BinaryDocValuesWriter.cs
index 19c783e..38addcf 100644
--- a/src/Lucene.Net/Index/BinaryDocValuesWriter.cs
+++ b/src/Lucene.Net/Index/BinaryDocValuesWriter.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -121,6 +122,7 @@ namespace Lucene.Net.Index
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state, DocValuesConsumer dvConsumer)
         {
             int maxDoc = state.SegmentInfo.DocCount;
@@ -128,6 +130,7 @@ namespace Lucene.Net.Index
             dvConsumer.AddBinaryField(fieldInfo, GetBytesIterator(maxDoc));
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/BufferedUpdatesStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/BufferedUpdatesStream.cs b/src/Lucene.Net/Index/BufferedUpdatesStream.cs
index ffce501..222d1be 100644
--- a/src/Lucene.Net/Index/BufferedUpdatesStream.cs
+++ b/src/Lucene.Net/Index/BufferedUpdatesStream.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
 {
@@ -177,6 +178,7 @@ namespace Lucene.Net.Index
         /// actual deleted docIDs in the liveDocs <see cref="Util.IMutableBits"/> for
         /// each <see cref="SegmentReader"/>.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual ApplyDeletesResult ApplyDeletesAndUpdates(IndexWriter.ReaderPool readerPool, IList<SegmentCommitInfo> infos)
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
index 12b4340..6c3d525 100644
--- a/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
+++ b/src/Lucene.Net/Index/ConcurrentMergeScheduler.cs
@@ -2,6 +2,7 @@
 using Lucene.Net.Support.Threading;
 using System;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading;
 
@@ -411,6 +412,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
         {
             lock (this)
@@ -524,6 +526,7 @@ namespace Lucene.Net.Index
 
         /// <summary>
         /// Does the actual merge, by calling <see cref="IndexWriter.Merge(MergePolicy.OneMerge)"/> </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         protected virtual void DoMerge(MergePolicy.OneMerge merge)
         {
             m_writer.Merge(merge);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocConsumer.cs b/src/Lucene.Net/Index/DocConsumer.cs
index c764fce..b00a6b9 100644
--- a/src/Lucene.Net/Index/DocConsumer.cs
+++ b/src/Lucene.Net/Index/DocConsumer.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -21,10 +23,13 @@ namespace Lucene.Net.Index
     {
         public abstract void ProcessDocument(FieldInfos.Builder fieldInfos);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void FinishDocument();
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Flush(SegmentWriteState state);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocFieldConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocFieldConsumer.cs b/src/Lucene.Net/Index/DocFieldConsumer.cs
index 909d1e6..526bddf 100644
--- a/src/Lucene.Net/Index/DocFieldConsumer.cs
+++ b/src/Lucene.Net/Index/DocFieldConsumer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -25,16 +26,19 @@ namespace Lucene.Net.Index
         /// Called when <see cref="DocumentsWriterPerThread"/> decides to create a new
         /// segment
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Flush(IDictionary<string, DocFieldConsumerPerField> fieldsToFlush, SegmentWriteState state);
 
         /// <summary>
         /// Called when an aborting exception is hit </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Abort();
 
         public abstract void StartDocument();
 
         public abstract DocFieldConsumerPerField AddField(FieldInfo fi);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void FinishDocument();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocFieldConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocFieldConsumerPerField.cs b/src/Lucene.Net/Index/DocFieldConsumerPerField.cs
index 1e63a0c..9823533 100644
--- a/src/Lucene.Net/Index/DocFieldConsumerPerField.cs
+++ b/src/Lucene.Net/Index/DocFieldConsumerPerField.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -23,6 +25,7 @@ namespace Lucene.Net.Index
         /// Processes all occurrences of a single field </summary>
         public abstract void ProcessFields(IIndexableField[] fields, int count);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Abort();
 
         internal abstract FieldInfo FieldInfo { get; }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocFieldProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocFieldProcessor.cs b/src/Lucene.Net/Index/DocFieldProcessor.cs
index 3951ff4..df748eb 100644
--- a/src/Lucene.Net/Index/DocFieldProcessor.cs
+++ b/src/Lucene.Net/Index/DocFieldProcessor.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
 {
@@ -67,6 +68,7 @@ namespace Lucene.Net.Index
             this.storedConsumer = storedConsumer;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state)
         {
             IDictionary<string, DocFieldConsumerPerField> childFields = new Dictionary<string, DocFieldConsumerPerField>();
@@ -89,6 +91,7 @@ namespace Lucene.Net.Index
             infosWriter.Write(state.Directory, state.SegmentInfo.Name, "", state.FieldInfos, IOContext.DEFAULT);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             Exception th = null;
@@ -294,6 +297,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocInverter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocInverter.cs b/src/Lucene.Net/Index/DocInverter.cs
index fe5eec4..fc1ffda 100644
--- a/src/Lucene.Net/Index/DocInverter.cs
+++ b/src/Lucene.Net/Index/DocInverter.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -38,6 +39,7 @@ namespace Lucene.Net.Index
             this.endConsumer = endConsumer;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Flush(IDictionary<string, DocFieldConsumerPerField> fieldsToFlush, SegmentWriteState state)
         {
             IDictionary<string, InvertedDocConsumerPerField> childFieldsToFlush = new Dictionary<string, InvertedDocConsumerPerField>();
@@ -60,6 +62,7 @@ namespace Lucene.Net.Index
             endConsumer.StartDocument();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void FinishDocument()
         {
             // TODO: allow endConsumer.finishDocument to also return
@@ -68,6 +71,7 @@ namespace Lucene.Net.Index
             consumer.FinishDocument();
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Abort()
         {
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocInverterPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocInverterPerField.cs b/src/Lucene.Net/Index/DocInverterPerField.cs
index b9372a8..abe30da 100644
--- a/src/Lucene.Net/Index/DocInverterPerField.cs
+++ b/src/Lucene.Net/Index/DocInverterPerField.cs
@@ -1,4 +1,5 @@
 using Lucene.Net.Analysis.TokenAttributes;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -47,6 +48,7 @@ namespace Lucene.Net.Index
             this.endConsumer = parent.endConsumer.AddField(this, fieldInfo);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Abort()
         {
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocValuesFieldUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocValuesFieldUpdates.cs b/src/Lucene.Net/Index/DocValuesFieldUpdates.cs
index 9f6c34b..c2de183 100644
--- a/src/Lucene.Net/Index/DocValuesFieldUpdates.cs
+++ b/src/Lucene.Net/Index/DocValuesFieldUpdates.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Support;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -164,6 +165,7 @@ namespace Lucene.Net.Index
         /// segment which received updates while it was being merged. The given updates
         /// should override whatever updates are in that instance.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Merge(DocValuesFieldUpdates other);
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocValuesProcessor.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocValuesProcessor.cs b/src/Lucene.Net/Index/DocValuesProcessor.cs
index d8f80ff..016c3d6 100644
--- a/src/Lucene.Net/Index/DocValuesProcessor.cs
+++ b/src/Lucene.Net/Index/DocValuesProcessor.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Documents;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -46,6 +47,7 @@ namespace Lucene.Net.Index
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
         }
@@ -83,6 +85,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state)
         {
             if (writers.Count > 0)
@@ -219,6 +222,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
             foreach (DocValuesWriter writer in writers.Values)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocValuesWriter.cs b/src/Lucene.Net/Index/DocValuesWriter.cs
index f995021..6439a98 100644
--- a/src/Lucene.Net/Index/DocValuesWriter.cs
+++ b/src/Lucene.Net/Index/DocValuesWriter.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -21,10 +23,12 @@ namespace Lucene.Net.Index
 
     internal abstract class DocValuesWriter
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         public abstract void Finish(int numDoc);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Flush(SegmentWriteState state, DocValuesConsumer consumer);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocumentsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocumentsWriter.cs b/src/Lucene.Net/Index/DocumentsWriter.cs
index fbecda3..8fe9da7 100644
--- a/src/Lucene.Net/Index/DocumentsWriter.cs
+++ b/src/Lucene.Net/Index/DocumentsWriter.cs
@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Threading;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -247,6 +248,7 @@ namespace Lucene.Net.Index
         ///  currently buffered docs.  this resets our state,
         ///  discarding any docs added since last flush.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void Abort(IndexWriter writer)
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/DocumentsWriterPerThread.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/DocumentsWriterPerThread.cs b/src/Lucene.Net/Index/DocumentsWriterPerThread.cs
index a517ccf..aef08d0 100644
--- a/src/Lucene.Net/Index/DocumentsWriterPerThread.cs
+++ b/src/Lucene.Net/Index/DocumentsWriterPerThread.cs
@@ -4,6 +4,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Threading;
 
 namespace Lucene.Net.Index
@@ -161,6 +162,7 @@ namespace Lucene.Net.Index
         /// currently buffered docs.  this resets our state,
         /// discarding any docs added since last flush.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal virtual void Abort(ISet<string> createdFiles)
         {
             //System.out.println(Thread.currentThread().getName() + ": now abort seg=" + segmentInfo.name);
@@ -418,6 +420,7 @@ namespace Lucene.Net.Index
             return docCount;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void FinishDocument(Term delTerm)
         {
             /*
@@ -513,6 +516,7 @@ namespace Lucene.Net.Index
 
         /// <summary>
         /// Flush all pending docs to a new segment </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal virtual FlushedSegment Flush()
         {
             Debug.Assert(numDocsInRAM > 0);
@@ -612,6 +616,7 @@ namespace Lucene.Net.Index
         /// Seals the <see cref="Index.SegmentInfo"/> for the new flushed segment and persists
         /// the deleted documents <see cref="IMutableBits"/>.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal virtual void SealFlushedSegment(FlushedSegment flushedSegment)
         {
             Debug.Assert(flushedSegment != null);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/FreqProxTermsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/FreqProxTermsWriter.cs b/src/Lucene.Net/Index/FreqProxTermsWriter.cs
index 23590ae..7b6c21d 100644
--- a/src/Lucene.Net/Index/FreqProxTermsWriter.cs
+++ b/src/Lucene.Net/Index/FreqProxTermsWriter.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -27,6 +28,7 @@ namespace Lucene.Net.Index
 
     internal sealed class FreqProxTermsWriter : TermsHashConsumer
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         { }
 
@@ -35,6 +37,7 @@ namespace Lucene.Net.Index
         // under the same FieldInfo together, up into TermsHash*.
         // Other writers would presumably share alot of this...
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(IDictionary<string, TermsHashConsumerPerField> fieldsToFlush, SegmentWriteState state)
         {
             // Gather all FieldData's that have postings, across all
@@ -120,6 +123,7 @@ namespace Lucene.Net.Index
             return new FreqProxTermsWriterPerField(termsHashPerField, this, fieldInfo);
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument(TermsHash termsHash)
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs b/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs
index 776c605..f8053d3 100644
--- a/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs
+++ b/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Support;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -384,6 +385,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Abort()
         {
         }
@@ -395,6 +397,7 @@ namespace Lucene.Net.Index
         /// instances) found in this field and serialize them
         /// into a single RAM segment.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void Flush(string fieldName, FieldsConsumer consumer, SegmentWriteState state)
         {
             if (!fieldInfo.IsIndexed)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/IMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/IMergeScheduler.cs b/src/Lucene.Net/Index/IMergeScheduler.cs
index 0d2d384..7f5b983 100644
--- a/src/Lucene.Net/Index/IMergeScheduler.cs
+++ b/src/Lucene.Net/Index/IMergeScheduler.cs
@@ -1,4 +1,5 @@
 ´╗┐using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -22,6 +23,7 @@ namespace Lucene.Net.Index
     // LUCENENET specific
     public interface IMergeScheduler : ICloneable, IDisposable
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound);
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/IndexWriter.cs b/src/Lucene.Net/Index/IndexWriter.cs
index e3ddb15..9a3a893 100644
--- a/src/Lucene.Net/Index/IndexWriter.cs
+++ b/src/Lucene.Net/Index/IndexWriter.cs
@@ -7,6 +7,7 @@ using System.Globalization;
 using System.IO;
 using System.Linq;
 using System.Reflection;
+using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading;
 
@@ -1042,6 +1043,7 @@ namespace Lucene.Net.Index
         /// <see cref="IndexWriter"/> for details.</para>
         /// </summary>
         /// <exception cref="IOException"> if there is a low-level IO error </exception>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Dispose()
         {
             Dispose(true);
@@ -1070,6 +1072,7 @@ namespace Lucene.Net.Index
         /// running merges to abort, wait until those merges have
         /// finished (which should be at most a few seconds), and
         /// then return. </param>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void Dispose(bool waitForMerges)
         {
             // Ensure that only one thread actually gets to do the
@@ -2522,6 +2525,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void RollbackInternal()
         {
             bool success = false;
@@ -3840,6 +3844,7 @@ namespace Lucene.Net.Index
         /// <param name="triggerMerge"> if <c>true</c>, we may merge segments (if
         /// deletes or docs were flushed) if necessary </param>
         /// <param name="applyAllDeletes"> whether pending deletes should also </param>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Flush(bool triggerMerge, bool applyAllDeletes)
         {
             // NOTE: this method cannot be sync'd because
@@ -4541,6 +4546,7 @@ namespace Lucene.Net.Index
         /// <para/>
         /// @lucene.experimental
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void Merge(MergePolicy.OneMerge merge)
         {
             bool success = false;
@@ -5920,6 +5926,7 @@ namespace Lucene.Net.Index
         /// (unlike <see cref="File.Exists(string)"/>) throws <see cref="IOException"/> if
         /// there's some unexpected error.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private static bool SlowFileExists(Directory dir, string fileName)
         {
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/InvertedDocConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/InvertedDocConsumer.cs b/src/Lucene.Net/Index/InvertedDocConsumer.cs
index 6844c9d..dfd4031 100644
--- a/src/Lucene.Net/Index/InvertedDocConsumer.cs
+++ b/src/Lucene.Net/Index/InvertedDocConsumer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -23,16 +24,19 @@ namespace Lucene.Net.Index
     {
         /// <summary>
         /// Abort (called after hitting AbortException) </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
 
         /// <summary>
         /// Flush a new segment </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Flush(IDictionary<string, InvertedDocConsumerPerField> fieldsToFlush, SegmentWriteState state);
 
         internal abstract InvertedDocConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo);
 
         internal 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/InvertedDocConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/InvertedDocConsumerPerField.cs b/src/Lucene.Net/Index/InvertedDocConsumerPerField.cs
index e6d1a4e..c6cc498 100644
--- a/src/Lucene.Net/Index/InvertedDocConsumerPerField.cs
+++ b/src/Lucene.Net/Index/InvertedDocConsumerPerField.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -36,6 +38,7 @@ namespace Lucene.Net.Index
         internal abstract void Finish();
 
         // Called on hitting an aborting exception
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Abort();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/InvertedDocEndConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/InvertedDocEndConsumer.cs b/src/Lucene.Net/Index/InvertedDocEndConsumer.cs
index 047a223..33db5c3 100644
--- a/src/Lucene.Net/Index/InvertedDocEndConsumer.cs
+++ b/src/Lucene.Net/Index/InvertedDocEndConsumer.cs
@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -21,14 +22,17 @@ namespace Lucene.Net.Index
 
     internal abstract class InvertedDocEndConsumer
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Flush(IDictionary<string, InvertedDocEndConsumerPerField> fieldsToFlush, SegmentWriteState state);
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Abort();
 
         internal abstract InvertedDocEndConsumerPerField AddField(DocInverterPerField docInverterPerField, FieldInfo fieldInfo);
 
         internal 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/InvertedDocEndConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/InvertedDocEndConsumerPerField.cs b/src/Lucene.Net/Index/InvertedDocEndConsumerPerField.cs
index 909ed79..ee8b67c 100644
--- a/src/Lucene.Net/Index/InvertedDocEndConsumerPerField.cs
+++ b/src/Lucene.Net/Index/InvertedDocEndConsumerPerField.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -21,6 +23,7 @@ namespace Lucene.Net.Index
     {
         internal abstract void Finish();
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal abstract void Abort();
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/MergePolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/MergePolicy.cs b/src/Lucene.Net/Index/MergePolicy.cs
index f40f264..5519bc0 100644
--- a/src/Lucene.Net/Index/MergePolicy.cs
+++ b/src/Lucene.Net/Index/MergePolicy.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Util;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 #if FEATURE_SERIALIZABLE_EXCEPTIONS
 using System.Runtime.Serialization;
 #endif
@@ -259,6 +260,7 @@ namespace Lucene.Net.Index
             /// before the merge is committed then the merge will
             /// not be committed.
             /// </summary>
+            [MethodImpl(MethodImplOptions.NoInlining)]
             internal virtual void Abort()
             {
                 lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/MergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/MergeScheduler.cs b/src/Lucene.Net/Index/MergeScheduler.cs
index 8e45028..1080178 100644
--- a/src/Lucene.Net/Index/MergeScheduler.cs
+++ b/src/Lucene.Net/Index/MergeScheduler.cs
@@ -1,4 +1,5 @@
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -45,6 +46,7 @@ namespace Lucene.Net.Index
         /// <param name="trigger"> the <see cref="MergeTrigger"/> that caused this merge to happen </param>
         /// <param name="newMergesFound"> <c>true</c> iff any new merges were found by the caller; otherwise <c>false</c>
         ///  </param>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public abstract void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound);
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/NoMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/NoMergeScheduler.cs b/src/Lucene.Net/Index/NoMergeScheduler.cs
index 29c7b37..da75d1d 100644
--- a/src/Lucene.Net/Index/NoMergeScheduler.cs
+++ b/src/Lucene.Net/Index/NoMergeScheduler.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -42,6 +44,7 @@ namespace Lucene.Net.Index
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/NormsConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/NormsConsumer.cs b/src/Lucene.Net/Index/NormsConsumer.cs
index 99a281c..178d8c1 100644
--- a/src/Lucene.Net/Index/NormsConsumer.cs
+++ b/src/Lucene.Net/Index/NormsConsumer.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -34,10 +35,12 @@ namespace Lucene.Net.Index
 
     internal sealed class NormsConsumer : InvertedDocEndConsumer
     {
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Abort()
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Flush(IDictionary<string, InvertedDocEndConsumerPerField> fieldsToFlush, SegmentWriteState state)
         {
             bool success = false;
@@ -84,6 +87,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void FinishDocument()
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/NormsConsumerPerField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/NormsConsumerPerField.cs b/src/Lucene.Net/Index/NormsConsumerPerField.cs
index 332ebce..11714e6 100644
--- a/src/Lucene.Net/Index/NormsConsumerPerField.cs
+++ b/src/Lucene.Net/Index/NormsConsumerPerField.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Support;
 using System;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -57,6 +58,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void Flush(SegmentWriteState state, DocValuesConsumer normsWriter)
         {
             int docCount = state.SegmentInfo.DocCount;
@@ -78,6 +80,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal override void Abort()
         {
             //

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs b/src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs
index eeff0bc..add4a1c 100644
--- a/src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs
+++ b/src/Lucene.Net/Index/NumericDocValuesFieldUpdates.cs
@@ -1,6 +1,7 @@
 using Lucene.Net.Documents;
 using System;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -208,6 +209,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(DocValuesFieldUpdates other)
         {
             Debug.Assert(other is NumericDocValuesFieldUpdates);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/NumericDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/NumericDocValuesWriter.cs b/src/Lucene.Net/Index/NumericDocValuesWriter.cs
index 4129739..a1ec997 100644
--- a/src/Lucene.Net/Index/NumericDocValuesWriter.cs
+++ b/src/Lucene.Net/Index/NumericDocValuesWriter.cs
@@ -1,5 +1,6 @@
 using Lucene.Net.Util.Packed;
 using System.Collections.Generic;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -91,6 +92,7 @@ namespace Lucene.Net.Index
         {
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state, DocValuesConsumer dvConsumer)
         {
             int maxDoc = state.SegmentInfo.DocCount;
@@ -130,6 +132,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/PersistentSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/PersistentSnapshotDeletionPolicy.cs b/src/Lucene.Net/Index/PersistentSnapshotDeletionPolicy.cs
index 57c20c4..659e066 100644
--- a/src/Lucene.Net/Index/PersistentSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net/Index/PersistentSnapshotDeletionPolicy.cs
@@ -2,6 +2,7 @@ using Lucene.Net.Support;
 using System;
 using System.Collections.Generic;
 using System.IO;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -199,6 +200,7 @@ namespace Lucene.Net.Index
             }
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void Persist()
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/ReadersAndUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/ReadersAndUpdates.cs b/src/Lucene.Net/Index/ReadersAndUpdates.cs
index 6e4cb03..08a8bb7 100644
--- a/src/Lucene.Net/Index/ReadersAndUpdates.cs
+++ b/src/Lucene.Net/Index/ReadersAndUpdates.cs
@@ -4,6 +4,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Globalization;
+using System.Runtime.CompilerServices;
 using System.Text;
 
 namespace Lucene.Net.Index
@@ -289,6 +290,7 @@ namespace Lucene.Net.Index
         /// Returns a ref to a clone. NOTE: you should <see cref="DecRef()"/> the reader when you're
         /// done (ie do not call <see cref="IndexReader.Dispose()"/>).
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual SegmentReader GetReadOnlyClone(IOContext context)
         {
             lock (this)
@@ -386,6 +388,7 @@ namespace Lucene.Net.Index
         // _X_N updates files) to the directory; returns true if it wrote any file
         // and false if there were no new deletes or updates to write:
         // TODO (DVU_RENAME) to writeDeletesAndUpdates
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual bool WriteLiveDocs(Directory dir)
         {
             lock (this)
@@ -450,6 +453,7 @@ namespace Lucene.Net.Index
         }
 
         // Writes field updates (new _X_N updates files) to the directory
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public virtual void WriteFieldUpdates(Directory dir, DocValuesFieldUpdates.Container dvUpdates)
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/SegmentInfos.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SegmentInfos.cs b/src/Lucene.Net/Index/SegmentInfos.cs
index 6b5de9b..3de75ba 100644
--- a/src/Lucene.Net/Index/SegmentInfos.cs
+++ b/src/Lucene.Net/Index/SegmentInfos.cs
@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading;
 
@@ -340,6 +341,7 @@ namespace Lucene.Net.Index
         /// <param name="segmentFileName"> segment file to load </param>
         /// <exception cref="CorruptIndexException"> if the index is corrupt </exception>
         /// <exception cref="IOException"> if there is a low-level IO error </exception>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Read(Directory directory, string segmentFileName)
         {
             var success = false;
@@ -458,6 +460,7 @@ namespace Lucene.Net.Index
         /// Find the latest commit (<c>segments_N file</c>) and
         /// load all <see cref="SegmentCommitInfo"/>s.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public void Read(Directory directory)
         {
             generation = lastGeneration = -1;
@@ -1139,6 +1142,7 @@ namespace Lucene.Net.Index
         /// method if changes have been made to this <see cref="SegmentInfos"/> instance
         /// </para>
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void PrepareCommit(Directory dir)
         {
             if (pendingSegnOutput != null)
@@ -1180,6 +1184,7 @@ namespace Lucene.Net.Index
             return files;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal void FinishCommit(Directory dir)
         {
             if (pendingSegnOutput == null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/SegmentMerger.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SegmentMerger.cs b/src/Lucene.Net/Index/SegmentMerger.cs
index 38513f5..9c6fa21 100644
--- a/src/Lucene.Net/Index/SegmentMerger.cs
+++ b/src/Lucene.Net/Index/SegmentMerger.cs
@@ -3,6 +3,7 @@ using System;
 using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -85,6 +86,7 @@ namespace Lucene.Net.Index
         /// <returns> The number of documents that were merged </returns>
         /// <exception cref="CorruptIndexException"> if the index is corrupt </exception>
         /// <exception cref="System.IO.IOException"> if there is a low-level IO error </exception>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         internal MergeState Merge()
         {
             if (!ShouldMerge)
@@ -437,6 +439,7 @@ namespace Lucene.Net.Index
             return docBase;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         private void MergeTerms(SegmentWriteState segmentWriteState)
         {
             IList<Fields> fields = new List<Fields>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/SerialMergeScheduler.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SerialMergeScheduler.cs b/src/Lucene.Net/Index/SerialMergeScheduler.cs
index d65b21f..fcfa922 100644
--- a/src/Lucene.Net/Index/SerialMergeScheduler.cs
+++ b/src/Lucene.Net/Index/SerialMergeScheduler.cs
@@ -1,3 +1,5 @@
+using System.Runtime.CompilerServices;
+
 namespace Lucene.Net.Index
 {
     /*
@@ -34,6 +36,7 @@ namespace Lucene.Net.Index
         /// "synchronized" so that even if the application is using
         /// multiple threads, only one merge may run at a time.
         /// </summary>
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound) // LUCENENET NOTE: This was internal in the original, but the base class is public so there isn't much choice here
         {
             lock (this)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/4abbd4be/src/Lucene.Net/Index/SortedDocValuesWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Index/SortedDocValuesWriter.cs b/src/Lucene.Net/Index/SortedDocValuesWriter.cs
index a8b58da..fb33062 100644
--- a/src/Lucene.Net/Index/SortedDocValuesWriter.cs
+++ b/src/Lucene.Net/Index/SortedDocValuesWriter.cs
@@ -3,6 +3,7 @@ using Lucene.Net.Util;
 using Lucene.Net.Util.Packed;
 using System.Collections.Generic;
 using System.Diagnostics;
+using System.Runtime.CompilerServices;
 
 namespace Lucene.Net.Index
 {
@@ -107,6 +108,7 @@ namespace Lucene.Net.Index
             bytesUsed = newBytesUsed;
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Flush(SegmentWriteState state, DocValuesConsumer dvConsumer)
         {
             int maxDoc = state.SegmentInfo.DocCount;
@@ -127,6 +129,7 @@ namespace Lucene.Net.Index
                                       GetOrdsEnumberable(maxDoc, ordMap));
         }
 
+        [MethodImpl(MethodImplOptions.NoInlining)]
         public override void Abort()
         {
         }


Mime
View raw message