Check a local attribute for the SMB log switch instead#38819
Merged
AlexAndBear merged 2 commits intomasterfrom Jun 10, 2021
Merged
Check a local attribute for the SMB log switch instead#38819AlexAndBear merged 2 commits intomasterfrom
AlexAndBear merged 2 commits intomasterfrom
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
AlexAndBear
approved these changes
Jun 10, 2021
Member
Author
|
That's the data I have. So I guess, without the patch, the method takes 0.63% of the time, and with the patch it takes 0.07%. The data refers to the WND app, but the SMB app should have similar results. Changelog items incoming. |
|
Kudos, SonarCloud Quality Gate passed! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
Use a local attribute to decide whether to log something in the SMB connector or not
It also improves the log handling in the subclasses because the inherited methods will use the same flag
Related Issue
Related to https://github.com/owncloud/enterprise/issues/4594
Motivation and Context
Just deciding to log nothing in the connector takes some time. It might be a few microseconds, but the sheer amount of calls that big installations can make might rise this number a lot.
For a particular setup with a folder with 1000 files and another folder inside, there are 73240 calls to the log method. Although each call could take around 10-15 microseconds per call on average, the total amount takes close to 1 second in order to log nothing.
This PR make the logging calls to take nanoseconds if the logging is disabled. For the same amount of data, the waste should be around 10 miliseconds instead of 1 second.
Side note: the request takes around 35 seconds, so it isn't a big gain.
How Has This Been Tested?
Manually tested. Checked with a propfind against the folder with 1000 files using curl, as well as navigating to the folder using the browser. In both cases, a file scan was forced to be triggered with the propfind.
Screenshots (if appropriate):
Types of changes
Checklist: