Skip to content
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

Remove unused imports from scoop prefix command #261

Closed
wants to merge 1 commit into from
Closed

Remove unused imports from scoop prefix command #261

wants to merge 1 commit into from

Conversation

CrendKing
Copy link

Currently scoop prefix takes almost half a second to complete:

> Measure-Command { scoop prefix curl }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 404
Ticks             : 4043902
TotalDays         : 4.68044212962963E-06
TotalHours        : 0.000112330611111111
TotalMinutes      : 0.00673983666666667
TotalSeconds      : 0.4043902
TotalMilliseconds : 404.3902

Considering how often this command is usually used, this drastically reduced the whole system performance. For example, oh-my-posh's installation doc page has this script: "$(scoop prefix oh-my-posh)\themes\jandedobbeleer.omp.json".

I noticed 4 of the 6 import libraries are not currently used. Removing them reduces the time to 120ms:

> Measure-Command { scoop prefix curl }

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 121
Ticks             : 1217310
TotalDays         : 1.40892361111111E-06
TotalHours        : 3.38141666666667E-05
TotalMinutes      : 0.00202885
TotalSeconds      : 0.121731
TotalMilliseconds : 121.731

Although this is still way too long in my opinion, it's much better. I hope you guys can keep going with improving this command.

Copy link
Owner

@Ash258 Ash258 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never open PR to main branch. On other hand when you cannot properly name the PR based on all of the commits/PR you should never contribute.

@@ -6,11 +6,7 @@

@(
@('core', 'Test-ScoopDebugEnabled'),
@('getopt', 'Resolve-GetOpt'),
@('help', 'scoop_help'),
@('Helpers', 'New-IssuePrompt'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed

@@ -6,11 +6,7 @@

@(
@('core', 'Test-ScoopDebugEnabled'),
@('getopt', 'Resolve-GetOpt'),
@('help', 'scoop_help'),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needed

@Ash258 Ash258 added the invalid This doesn't seem right label Jan 10, 2022
@Ash258 Ash258 mentioned this pull request Jan 23, 2022
3 tasks
Ash258 added a commit that referenced this pull request Jan 28, 2022
@CrendKing CrendKing closed this Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants