-
-
Notifications
You must be signed in to change notification settings - Fork 437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Speedup windows by only fetching the necessary blocks #475
Conversation
…d owner and group data if they are not needed. That creates massive speedup on Domain machines.
Codecov Report
@@ Coverage Diff @@
## master #475 +/- ##
==========================================
- Coverage 84.58% 84.20% -0.38%
==========================================
Files 35 35
Lines 3353 3431 +78
==========================================
+ Hits 2836 2889 +53
- Misses 517 542 +25
Continue to review full report at Codecov.
|
Hey, I had given implementing this a shot after out discussions in #297 . There is one issue in that we use this information to get color/icon in for the name block. Due to this skipping this just because we do not have a permissions block is not really a good idea. With that out of the way, I was not sure what the best way forward would be. One solution that comes to mind is to have something like We could however handle the cases in which we error out when trying to fetch "world" permissions buy dropping a |
Even just fetching the owner permissions only in a domain in windows takes a looong time. |
I don't think we should be skipping fetching owner as well. Once you start removing things like color/permissions completely, I think it is better to use a tool that would be better suited for the job than trying to make Ignoring group/other(world) kinda makes sense to me as those don't translate over to Windows from what I understand, but we should at least keep |
For most Windows users, they are single-user machines. Ownership etc. rarely comes up, other than sometimes needing to click a "Whatever" button on a prompt. I don't think this information is significantly meaningful for the majority of Windows users -- even "do I have permissions to do X on this file" is not that useful, because 99% of the time they can just get the permission they need trivially. So I don't think it makes sense to push a massive perf hit on One thing that's kind of interesting is that |
Closing this. #484 seems to be better for now. |
Can you maybe re-open? The other pr doesn’t seem to be moving, plus this one is more dynamic as it doesn’t require a special compilation |
#475 (comment) is my issue with this implementation. It sort of starts removing features even for users without this issue at that point. |
@meain I think there has been a misunderstanding as to what this PR does. It doesn't remove any features or change any of the outputs for users. Right now, lsd always fetches permissions, even if the block isn't selected by the user. All this PR does, is that for permissions for windows, it checks first if the block is requested, and if it doesn't it doesn't fetch it. Users who use the blocks will still have them with no change, an users who don't use them will not have the penalty. |
@AsafMah , I was not able to go through the code again, but if I am remembering correctly doing https://github.com/Peltoche/lsd/pull/475/files#diff-656cbac8b68ed3a36ace232e395f1bb1246301342cda210688d60babec27cda1R33-R39 will disable fetching permissions if they don't have that block and that will result in the file colors being different as we will not have information about things like if the file is an executable. |
Now from_path is aware of blocks, so it will not fetch permissions and owner and group data if they are not needed.
That creates massive speedup on Domain machines.
Based on the discussion in: #297
cargo fmt