Skip to content

VisionIpcServer: avoid vector copy in get_buffer() - #655

Merged
adeebshihadeh merged 1 commit into
commaai:masterfrom
deanlee:use-reference
Sep 6, 2026
Merged

VisionIpcServer: avoid vector copy in get_buffer()#655
adeebshihadeh merged 1 commit into
commaai:masterfrom
deanlee:use-reference

Conversation

@deanlee

@deanlee deanlee commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

get_buffer() was copying the entire buffers vector on every call:

auto b = buffers[type]; // Creates a full copy of vector<VisionBuf*>

This PR switches to a const& to avoid the copy, reducing overhead.

@adeebshihadeh
adeebshihadeh merged commit ea547f3 into commaai:master Sep 6, 2026
2 checks passed
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