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

[v1.15] Lazily initialize assets #2236

Merged

Conversation

zimnx
Copy link
Collaborator

@zimnx zimnx commented Dec 4, 2024

Backport of #2233

Assets kept as global variables are moved to structure which is lazily initialized upon first usage.
This speeds up binary startup as cpu heavy initialization is done at later stage.
Thanks to this, contianers which are running side commands - usually under contstrained resources - doesn't need to process them if they are not using them.

ScyllaDB-ignition container which previously required ~2min to start the command:
```
I1203 18:59:28.325125       1 operator/cmd.go:21] maxprocs: Updating GOMAXPROCS=1: using minimum allowed GOMAXPROCS
I1203 19:01:37.837439       1 operator/ignition.go:156] run-ignition version "v0.0.0-alpha.0-110-g9d9a586"
```

With this change it's almost immediate:
```
I1203 20:04:35.334993       1 operator/cmd.go:21] maxprocs: Updating GOMAXPROCS=[1]: using minimum allowed GOMAXPROCS
I1203 20:04:35.337488       1 operator/ignition.go:156] run-ignition version "v1.16.0-alpha.0-23-g70ff0f6"
```
@zimnx zimnx added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Dec 4, 2024
@scylla-operator-bot scylla-operator-bot bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 4, 2024
@scylla-operator-bot scylla-operator-bot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 4, 2024
@zimnx zimnx changed the title Lazily initialize assets [v1.15] Lazily initialize assets Dec 4, 2024
Copy link
Contributor

@tnozicka tnozicka left a comment

Choose a reason for hiding this comment

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

/lgtm
thanks

@scylla-operator-bot scylla-operator-bot bot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2024
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tnozicka, zimnx

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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tnozicka tnozicka added this to the v1.15.0 milestone Dec 5, 2024
@scylla-operator-bot scylla-operator-bot bot merged commit 69c8eec into scylladb:v1.15 Dec 5, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants