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 file resource performance #310

Merged
merged 1 commit into from
Apr 5, 2020

Conversation

labocho
Copy link
Contributor

@labocho labocho commented Mar 26, 2020

Now, Itamae::Resource::File#pre_action always transfer file content. But when the file is not modified, it is not necessary and spends time.

In this pull request, if the file exists on remote and sha256sum command is available, compare digest and avoid unnecessary file transfer.

30%+ faster in the benchmark below.
https://gist.github.com/labocho/23f8e089205a507e6089ce1e8ce5a863

@unasuke
Copy link
Member

unasuke commented Mar 26, 2020

@labocho Could you squash those commits?

If file exists on remote and sha256sum command is available, compare digest and avoid unnecessary file transfer.
@labocho labocho force-pushed the optimize-file-resource branch from a088101 to 42aa18f Compare March 26, 2020 09:50
@labocho
Copy link
Contributor Author

labocho commented Mar 26, 2020

@unasuke Yes! Done.

@unasuke unasuke requested review from unasuke and sue445 April 1, 2020 02:09
Copy link
Member

@unasuke unasuke left a comment

Choose a reason for hiding this comment

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

It seems good to me!

Copy link
Member

@sue445 sue445 left a comment

Choose a reason for hiding this comment

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

🙆

@sue445 sue445 merged commit e40a3d3 into itamae-kitchen:master Apr 5, 2020
@sue445
Copy link
Member

sue445 commented Apr 5, 2020

I released as v1.10.7 💎

@labocho
Copy link
Contributor Author

labocho commented Apr 5, 2020

Thanks!

@labocho labocho deleted the optimize-file-resource branch June 17, 2020 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants