You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/07/18 08:55:15 UTC

[2/2] lucenenet git commit: PERFORMANCE: Lucene.Net.Store.FSDirectory: Removed extra call to Flush() that was causing slow performance and moved the call to the Dispose() block.

PERFORMANCE: Lucene.Net.Store.FSDirectory: Removed extra call to Flush() that was causing slow performance and moved the call to the Dispose() block.


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

Branch: refs/heads/master
Commit: 012ffaab30f2f615aa40ec84d77d609e53d14a2e
Parents: dcb3caa
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Tue Jul 18 15:51:06 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Tue Jul 18 15:51:06 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net/Store/FSDirectory.cs | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/012ffaab/src/Lucene.Net/Store/FSDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Store/FSDirectory.cs b/src/Lucene.Net/Store/FSDirectory.cs
index d023e0d..8c65d9c 100644
--- a/src/Lucene.Net/Store/FSDirectory.cs
+++ b/src/Lucene.Net/Store/FSDirectory.cs
@@ -499,14 +499,6 @@ namespace Lucene.Net.Store
                 //Debug.Assert(size == 0);
             }
 
-            // LUCENENET specific - file.Flush(flushToDisk: true) required in .NET for concurrency
-            // Part of a solution suggested by Vincent Van Den Berghe: http://apache.markmail.org/message/hafnuhq2ydhfjmi2
-            public override void Flush()
-            {
-                base.Flush();
-                file.Flush(flushToDisk: true);
-            }
-
             protected override void Dispose(bool disposing)
             {
                 if (disposing)
@@ -519,6 +511,9 @@ namespace Lucene.Net.Store
                         try
                         {
                             base.Dispose(disposing);
+                            // LUCENENET specific - file.Flush(flushToDisk: true) required in .NET for concurrency
+                            // Part of a solution suggested by Vincent Van Den Berghe: http://apache.markmail.org/message/hafnuhq2ydhfjmi2
+                            file.Flush(flushToDisk: true);
                         }
                         catch (IOException ioe)
                         {