AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
322 stars 131 forks source link

Speedup Invoke-WebRequests by disabling progress indicator. #380

Closed sgtwilko closed 4 years ago

sgtwilko commented 4 years ago

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

Checklist

lipkau commented 4 years ago

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 commented 4 years ago

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!

sgtwilko commented 4 years ago

@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?