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

Speedup Invoke-WebRequests by disabling progress indicator. #380

Merged
merged 2 commits into from
Oct 28, 2019

Conversation

sgtwilko
Copy link
Contributor

@sgtwilko sgtwilko commented Oct 1, 2019

Description

Normal ProgressPreference really slows down invoke-webrequest as it tries to update the screen for bytes received.
By setting ProgressPreference to silentlyContinue it doesn't try to update the screen and speeds up the downloads.
See https://stackoverflow.com/a/43477248/2641196

Motivation and Context

This change make a reasonable difference to the speed of accessing Jira systems with large numbers of fields, or for methods that make large number of calls.
This improves, but does not entirely resolve #362

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have added Pester Tests that describe what my changes should do.
  • I have updated the documentation accordingly.

@sgtwilko sgtwilko requested review from a team as code owners October 1, 2019 01:52
@lipkau lipkau self-requested a review October 5, 2019 15:13
@lipkau
Copy link
Member

lipkau commented Oct 5, 2019

I don't see a problem with the code - but with the behavior, it introduces.

currently, the module respects the user's value for $ProgressPreference.
meaning: the user can have the behavior introduced with this PR by setting

$ProgressPreference = "SilentlyContinue"

in his script/console.

I need more opinions on this.
cc @brianbunke , @alexsuslin , @replicaJunction , @Dejulia489 , @beaudryj , @FriedrichWeinmann , @KevinMarquette

@brianbunke
Copy link
Contributor

Seems fine; the progress bar is pretty notorious at this point for its performance impact. I respect the argument for taking a choice away from the user, but I think improving performance by ~20% (per the linked issue) is understandable.

Thanks @sgtwilko!

@lipkau lipkau added this to the v2.13 milestone Oct 27, 2019
@lipkau lipkau merged commit af13ef6 into AtlassianPS:develop Oct 28, 2019
@sgtwilko
Copy link
Contributor Author

sgtwilko commented Jan 9, 2020

@lipkau Hiya, I upgraded recently and my change doesn't seem to be in the latest version.
Did I do something wrong when submitting this PR?

@lipkau lipkau mentioned this pull request Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants