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

reduce function calling #3540

Merged
merged 1 commit into from
Jul 10, 2024
Merged

reduce function calling #3540

merged 1 commit into from
Jul 10, 2024

Conversation

lowang-bh
Copy link
Member

@lowang-bh lowang-bh commented Jun 23, 2024

/kind cleanup

Signed-off-by: lowang-bh <[email protected]>
@volcano-sh-bot volcano-sh-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 23, 2024
@volcano-sh-bot
Copy link
Contributor

@lowang-bh: The label(s) kind/improvement, kind/clean-up cannot be applied. These labels are supported: ``

In response to this:

/kind improvement
/kind clean-up

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@volcano-sh-bot volcano-sh-bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 23, 2024
@@ -336,8 +336,9 @@ func (p TasksPriority) CalcPGMinResources(jobMinAvailable int32) v1.ResourceList
// calTaskRequests returns requests resource with validReplica replicas
func calTaskRequests(pod *v1.Pod, validReplica int32) v1.ResourceList {
minReq := v1.ResourceList{}
usage := *util.GetPodQuotaUsage(pod)
for i := int32(0); i < validReplica; i++ {
Copy link
Member

Choose a reason for hiding this comment

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

If validReplica length=0, then util.GetPodQuotaUsage(pod) will not be called, but after this pr, it will always be called, is this feasible?

Copy link
Member Author

Choose a reason for hiding this comment

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

validReplica will nearly never be zero. So most cases GetPodQuotaUsage will only be called once. Even though it is zero, the logic is ok and has no other impact.

Copy link
Member

Choose a reason for hiding this comment

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

OK.

@Monokaix
Copy link
Member

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

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

/approve

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hwdef

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

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 10, 2024
@volcano-sh-bot volcano-sh-bot merged commit e2bd551 into volcano-sh:master Jul 10, 2024
14 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants