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

Improve performance when creating output zip payload #59

Merged
merged 1 commit into from
Sep 19, 2017
Merged

Improve performance when creating output zip payload #59

merged 1 commit into from
Sep 19, 2017

Conversation

danbelcher-MSFT
Copy link
Contributor

Improve performance when creating output zip payload.

We found there was a significant delay when creating the final zip output if the output path existed on a remote machine. We will change to compress the payload on the local machine before moving the output to the final destination.

In addition, added extra logging around commands that interact with the filesystem, so that future debugging will have an easier time determining the duration of the command.

Bumped the module version to 1.9.0

Copy link
Member

@HowardWolosky HowardWolosky left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

Write-Log "Writing submission request JSON file: [$OutFilePath]." -Level Verbose

$JsonObject |
ConvertTo-Json -Depth $script:jsonConversionDepth -Compress |
Copy link
Member

Choose a reason for hiding this comment

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

Can you indent these additional lines?

ConvertTo-Json -Depth $script:jsonConversionDepth -Compress |
Out-File -Encoding utf8 -FilePath $OutFilePath

Write-Log "Writing complete." -Level Verbose
Copy link
Member

Choose a reason for hiding this comment

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

Wasn't there value in including the $OutFilePath path in the log?

Write-Log "Writing merged JSON file: [$OutJsonPath]." -Level Verbose

$outJsonContent |
ConvertTo-Json -Depth $script:jsonConversionDepth -Compress |
Copy link
Member

Choose a reason for hiding this comment

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

Can you indent these lines?

destination. This gives better performance when the final destination is not on the local
machine.

The function uses no compression during the zip process, as we didn't see a noticeable
Copy link
Member

Choose a reason for hiding this comment

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

I'd update this comment (and the other one inside the method) to clarify that this is zipping appx/appxbundle/png files which themselves are already compressed. This wasn't a general statement on zip compression as a whole, simply for our specific use case.

…re moving to the destination.

This provides better performance when the destination is on a remote machine.

Additionally, add better logging so we can determine the time certain commands take to complete.

Bump module version to 1.9.0
@danbelcher-MSFT danbelcher-MSFT merged commit 43fa8dd into microsoft:master Sep 19, 2017
@danbelcher-MSFT danbelcher-MSFT deleted the user/dabelc/LogZipProcess branch September 19, 2017 23:20
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