openshift / backplane-tools

Manages the tools needed to interact with clusters
Apache License 2.0
4 stars 28 forks source link

Remove file.sync which is not mandatory and slow down a lot the install #62

Closed Tof1973 closed 6 months ago

Tof1973 commented 6 months ago

When we write data to target file from buffer using file.ReadFrom, we issue just after file.Sync to make sure that data are written even if program exit anormaly after. This extra caution is not really required here, and it delay a lot the installation in some case.

Here the delay installing gcloud with sync activated:

$ time ./dist/backplane-tools_linux_amd64_v1/backplane-tools install gcloud
Installing the following tools:
- gcloud google-cloud-cli-469.0.0-linux-x86_64

Installing gcloud
Successfully installed gcloud

real    0m14.211s
user    0m5.657s
sys     0m2.563s

And here the delay without sync:

$ time backplane-tools install gcloud
Installing the following tools:
- gcloud google-cloud-cli-469.0.0-linux-x86_64

Installing gcloud
Successfully installed gcloud

real    3m29.527s
user    0m7.626s
sys     0m9.223s
openshift-ci[bot] commented 6 months ago

@Tof1973: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
tnierman commented 6 months ago

/lgtm

tnierman commented 6 months ago

/approve

openshift-ci[bot] commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tnierman, Tof1973

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/openshift/backplane-tools/blob/main/OWNERS)~~ [tnierman] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment