fix(call): improve virtual background performance - #17450
Open
Antreesy wants to merge 3 commits into
Open
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Antreesy
force-pushed
the
fix/noid/virtual-bg-performance
branch
from
March 23, 2026 20:52
b75813b to
873612b
Compare
11 tasks
Antreesy
force-pushed
the
fix/noid/virtual-bg-performance
branch
from
April 2, 2026 10:58
873612b to
3291f0a
Compare
Antreesy
force-pushed
the
fix/noid/virtual-bg-performance
branch
from
June 10, 2026 15:05
3291f0a to
0362ce6
Compare
Antreesy
force-pushed
the
fix/noid/virtual-bg-performance
branch
from
September 1, 2026 13:14
0362ce6 to
c5e9ef3
Compare
- render loop was scheduled via TimerWorker that fired with 1000/frameRate interval - this allowed delay for up to 1-2 frames - requestVideoFrameCallback fires exactly when a new video frame is available - cancel on stopping the effect - add _lastInferenceTimestamp guard for MediaPipe's VIDEO mode (strictly requires incrementing values) - should reduce delay, but negligible Assisted-by: ClaudeCode:claude-sonnet-5 Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- when inference hasn't finished yet, previous _lastMask is reused for frame output - _lastMask references should be kept open until replaced ot not needed anymore - most noticeable, if inference is throttled (manually or due to perf issues) Assisted-by: ClaudeCode:claude-sonnet-5 Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
- texMaskFiltered, texBlurred1, texBlurred2 were reallocated on every single render() call - reallocating GPU texture every frame is a confirmed overhead on some GPUs/drivers - needs to be only reallocated when the actual size changes - similar with output canvas element - impact is negligible, so more a hardening Assisted-by: ClaudeCode:claude-sonnet-5 Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Antreesy
force-pushed
the
fix/noid/virtual-bg-performance
branch
from
September 1, 2026 13:16
c5e9ef3 to
941c071
Compare
Antreesy
marked this pull request as ready for review
September 1, 2026 13:17
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.
☑️ Resolves
Goal is to reduce GPU load while maintaining similar blur/mask quality and responsiveness
fix(virtual-bg): use requestVideoFrameCallback when available
fix(virtual-bg): keep _lastMask open while being reused
fix(virtual-bg): avoid GPU/canvas reallocation every frame
AI (if applicable)
🖌️ UI Checklist
🖼️ Screenshots / Screencasts
Tested on Windows with Intel(R) UHD Graphincs
🚧 Tasks
🏁 Checklist