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

image.py: don't call layer_tar.getmembers() twice in _squash_layers #69

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

vrutkovs
Copy link
Contributor

This should save a couple of seconds on large builds

@goldmann
Copy link
Owner

Just a side note from testing, your code performs like this with an example image:

[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m21.112s
user    0m6.653s
sys 0m4.190s
[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m21.198s
user    0m6.796s
sys 0m4.292s
[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m20.901s
user    0m6.520s
sys 0m4.250s

Master is at:

[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m21.347s
user    0m6.561s
sys 0m4.264s
[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m21.505s
user    0m6.705s
sys 0m4.155s
[root@performance docker-scripts]# time PYTHONPATH=. python docker_scripts/cli.py squash -f 7427c9af1454 -t image:squashed image:latest 2> /dev/null

real    0m19.983s
user    0m6.770s
sys 0m4.239s

Not that big difference :)

@goldmann
Copy link
Owner

Thanks, merging!

Related to #63.

@goldmann goldmann merged commit cb8f34a into goldmann:master Mar 29, 2016
@vrutkovs vrutkovs deleted the squashing_perf branch March 29, 2016 15:10
@goldmann goldmann mentioned this pull request Mar 29, 2016
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.

2 participants