Move `SaveTo` out of mutex
Previously #417 PR reverts this change for simplicity. But the performance result isn't good enough.
The reason for mutex wrapping SaveTo is to update the file ref count. This PR make the ref count atomic, so we can move SaveTo out of mutex.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign crazycs520 for approval. For more information see the Code Review Process. Please ensure that each of them provides their approval before proceeding.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment