Passes stage argument to avoid unnecessary stage retrieval calls#4322
Closed
Mayankm96 wants to merge 72 commits intoisaac-sim:mainfrom
Closed
Passes stage argument to avoid unnecessary stage retrieval calls#4322Mayankm96 wants to merge 72 commits intoisaac-sim:mainfrom
stage argument to avoid unnecessary stage retrieval calls#4322Mayankm96 wants to merge 72 commits intoisaac-sim:mainfrom
Conversation
…to feautre/xform-view
Contributor
Greptile SummaryThis PR implements a performance optimization by passing the Key Changes:
The changes follow a consistent pattern: functions that previously called Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User as User Code
participant Scene as InteractiveScene
participant Camera as Camera Sensor
participant XformView as XformPrimView
participant Spawner as Spawner Functions
participant USD as USD Context
participant Stage as USD Stage
Note over User,Stage: Before: Multiple get_current_stage() calls
User->>Scene: Initialize scene
Scene->>USD: get_current_stage()
USD-->>Scene: stage
Scene->>Camera: Initialize camera
Camera->>USD: get_current_stage()
USD-->>Camera: stage
Camera->>XformView: XFormPrim(path)
XformView->>USD: get_current_stage()
USD-->>XformView: stage
Note over User,Stage: After: Stage passed explicitly
User->>Scene: Initialize scene
Scene->>USD: get_current_stage() (once)
USD-->>Scene: stage
Scene->>Camera: Initialize camera (stage=stage)
Camera->>XformView: XformPrimView(path, stage=stage)
Note over XformView: Uses passed stage directly
Scene->>Spawner: spawn_shape(cfg, stage=stage)
Spawner->>Stage: bind_material(prim, material, stage=stage)
Note over Spawner,Stage: All operations use cached stage
Note over User,Stage: Performance Benefit: Eliminates redundant USD context calls
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This MR passes the
stageattribute to the functions where applicable. This helps avoid unnecessaryget_current_stage()calls as that calls the USD context and can be at times expensive. It is a better practice to give the stage as much as possible.Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there