Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

sleep for 0.1s instead of 1s in the wait_for_status loop #993

Merged
merged 1 commit into from
Jun 24, 2015

Conversation

rade
Copy link
Member

@rade rade commented Jun 23, 2015

This reduces weave launch|launch-dns execution time.

Closes #992.

On my machine, time weave launch takes ~1.95s before this change, and ~1.15s after.

@rade rade assigned dpw Jun 23, 2015
@dpw
Copy link
Contributor

dpw commented Jun 24, 2015

I'm bothered by the redundant sleep to check for the support for fractional sleeps. How about:

fractional_sleep() {
    case $1 in
        *.*)
            if [ -z "$NO_FRACTIONAL_SLEEP" ] ; then
                sleep $1 >/dev/null 2>&1 && return 0
                NO_FRACTIONAL_SLEEP=1
            fi
            sleep $((${1%.*} + 1))
            ;;
        *)
            sleep $1
            ;;
    esac
}

This reduces `weave launch|launch-dns` execution time.

Closes weaveworks#992.
@rade rade force-pushed the 992_fractional_sleep branch from 2d81dff to 4b11874 Compare June 24, 2015 11:17
@rade
Copy link
Member Author

rade commented Jun 24, 2015

I'm bothered by the redundant sleep

Thanks for that code. Incorporated.

@dpw dpw merged commit 4b11874 into weaveworks:master Jun 24, 2015
dpw added a commit that referenced this pull request Jun 24, 2015
Sleep for 0.1s instead of 1s in the wait_for_status loop.

Closes #992.
@rade rade modified the milestone: 1.1.0 Jul 2, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants