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

tk/export: introduce a configurable memory ballast #669

Merged
merged 2 commits into from
Feb 1, 2022

Conversation

jvrplmlmn
Copy link
Contributor

Context: At GrafanaLabs, we are currently trying to optimise how long it takes us to do a tk export operation of our jsonnet codebase.

We are currently testing different alternatives, one of them is leveraging a memory ballast to reduce the amount of time spent doing garbage collection.

I'm currently working on getting some hard data to back that up, but in the meantime, I'm proposing this PR which introduces a memory ballast behind a hidden flag for tk export.

@jvrplmlmn jvrplmlmn self-assigned this Jan 31, 2022
vars := workflowFlags(cmd.Flags())
getJsonnetOpts := jsonnetFlags(cmd.Flags())
getLabelSelector := labelSelectorFlag(cmd.Flags())

recursive := cmd.Flags().BoolP("recursive", "r", false, "Look recursively for Tanka environments")

cmd.Run = func(cmd *cli.Command, args []string) error {
// Allocate a block of memory to alter GC behaviour. See https://github.com/golang/go/issues/23044
Copy link
Member

Choose a reason for hiding this comment

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

@jvrplmlmn jvrplmlmn marked this pull request as ready for review February 1, 2022 12:24
@julienduchesne julienduchesne merged commit d70e38f into main Feb 1, 2022
@julienduchesne julienduchesne deleted the jvrplmlmn/tanka-with-memory-ballast branch February 1, 2022 12:36
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.

None yet

3 participants