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

[Core] Avoid status copy #47562

Merged
merged 2 commits into from
Sep 16, 2024
Merged

Conversation

dentiny
Copy link
Contributor

@dentiny dentiny commented Sep 9, 2024

This PR avoid Status copy at propagation macros.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@@ -49,7 +49,7 @@ class error_code;
// Return the given status if it is not OK.
#define RAY_RETURN_NOT_OK(s) \
do { \
::ray::Status _s = (s); \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The copy happens on critical path;
If passed-in s is a expression, it would be evaluated first, constant reference would do lifecycle extension.

Signed-off-by: dentiny <dentinyhao@gmail.com>
@dentiny dentiny changed the title [Improvement] Aoid status copy perf: Aoid status copy Sep 9, 2024
@dentiny dentiny changed the title perf: Aoid status copy perf: Avoid status copy Sep 9, 2024
@jjyao jjyao added the go add ONLY when ready to merge, run all tests label Sep 14, 2024
@jjyao jjyao changed the title perf: Avoid status copy [Core] Avoid status copy Sep 16, 2024
@jjyao jjyao merged commit f9e8e97 into ray-project:master Sep 16, 2024
4 of 5 checks passed
ujjawal-khare pushed a commit to ujjawal-khare-27/ray that referenced this pull request Oct 15, 2024
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: ujjawal-khare <ujjawal.khare@dream11.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants