Skip to content

Update livesplat_realsense.py#1

Open
ardabck wants to merge 1 commit intoaxbycc:mainfrom
ardabck:patch-1
Open

Update livesplat_realsense.py#1
ardabck wants to merge 1 commit intoaxbycc:mainfrom
ardabck:patch-1

Conversation

@ardabck
Copy link

@ardabck ardabck commented May 15, 2025

optimize matrix assembly by removing redundant reshaping and copying

optimize matrix assembly by removing redundant reshaping and copying
@jasonjmcghee
Copy link

Was this AI generated? Nothing is being optimized here. The code is equivalent.

@ardabck
Copy link
Author

ardabck commented May 15, 2025

haha no im a real person.
yeah functionally is equivalent but it was creating redundant arrays. which could be a problem with low spec devices.
this is not for CPU optimization. it is for memory optimization.

when gpus are better this could be a bottle neck at high FPS. so why not change it now?

edit: after checking who you are, i decided to do a real test to be 100% sure. it is way more probable that you are right :)

@jasonjmcghee
Copy link

I haven't memory profiled the code but wrapping in a np.array should be a no-op and the same reshape is happening. Afaict there's not a copy being replaced with an in-place operation.

Admittedly it's been a few years since I've worked with numpy but I would be blown away if inlining that variable (the core of the change) would reduce memory. It should just be a pointer to the same memory.

I've just been getting / seeing a number of ai generated prs that don't do what they claim so maybe I'm touchy / overstepping.

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.

2 participants

Comments