SincereXIA commented on pull request #616:
URL: https://github.com/apache/ratis/pull/616#issuecomment-1062524876


   > Since FileChannel is thread safe, let's call FileChannel.force(..) 
asynchronously so that we don't have to synchronize all the output stream 
calls; see 
https://issues.apache.org/jira/secure/attachment/13040845/616_asyncFileChannelForce.patch
   
   @szetszwo , Thanks for your opinion. We tested the performance of this patch:
   
   
![image](https://user-images.githubusercontent.com/20393870/157368650-63a25a0e-5d5b-4df2-a43c-dc99189c8bb8.png)
   
   
   Direct call `FileChannel.force(..)` does have better performance than 
synchronize all the output stream calls.
   
   But we find a issue, sleep at here is useless. Because this will block the 
main thread and will not reduce the total number of flushes. So I removed 
`flushIntervalMin` for now.
   
   
![image](https://user-images.githubusercontent.com/20393870/157367808-01217f80-b84b-46f1-93d5-31e796adc7db.png)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to