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

perf(export): only call FindEnvs once #553

Merged
merged 2 commits into from
Apr 12, 2021
Merged

perf(export): only call FindEnvs once #553

merged 2 commits into from
Apr 12, 2021

Conversation

Duologic
Copy link
Member

@Duologic Duologic commented Apr 12, 2021

On the internal Grafana Labs jsonnet code base, this can improve the performance of the export significantly. Tests on my local
machine went from 2m08s to 1m32s.

Copy link
Member

@sh0rez sh0rez left a comment

Choose a reason for hiding this comment

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

Nice work!

@@ -92,6 +80,7 @@ type parallelOut struct {

func parallelWorker(jobsCh <-chan parallelJob, outCh chan parallelOut) {
for job := range jobsCh {
log.Printf("Loading %s from %s", job.opts.Name, job.path)
Copy link
Member

Choose a reason for hiding this comment

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

Supposed to be here? Sounds quite verbose imo

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it intentionally. It gives a bit of feedback to the user as opposed to no feedback right now. I'm happy to remove or accept other suggestions to give a sense of progress.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. I'm not totally familiar, does this codepath affect any other actions than export?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not that I know off.

pkg/tanka/export.go Outdated Show resolved Hide resolved
@Duologic Duologic requested a review from sh0rez April 12, 2021 11:29
@@ -92,6 +80,7 @@ type parallelOut struct {

func parallelWorker(jobsCh <-chan parallelJob, outCh chan parallelOut) {
for job := range jobsCh {
log.Printf("Loading %s from %s", job.opts.Name, job.path)
Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. I'm not totally familiar, does this codepath affect any other actions than export?

@Duologic Duologic merged commit 17da685 into master Apr 12, 2021
@Duologic Duologic deleted the perf2 branch April 12, 2021 14:22
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.

2 participants