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

fix: prevent successive incline or decline to trigger onFallback in PerformanceMonitor #1791

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AxiomeCG
Copy link

Why

The flipflops is triggered by the successive call of onIncline or successive call of onDecline, which leads to the call of onFallback.
In particular, if you have successive improvement in performances that leads to the call of your last resort optimization in the onFallback. For example, you ask for the Effects in the EffectComposer to be better in onIncline and to disable totally the Effects in the onFallback, you see improvements, improvements, then you default fallback with no effects which defeat the purpose of the PerformanceMonitor.

resolves #1739

What

I have added a lastChange variable that keeps track of the last change to see if it was a decline before the incline or vice versa, which is what consist in a flipflop. It increments the value of flipped only if it switch back and forth between incline and decline, which is the instability we are searching in the first place.

Checklist

  • Ready to be merged

Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 30, 2024 11:38pm

Copy link

codesandbox-ci bot commented Jan 23, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit cac7d3d:

Sandbox Source
cranky-pare-2gmwd4 Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@drcmda
Copy link
Member

drcmda commented Jan 30, 2024

is it ready @AxiomeCG ?

@AxiomeCG
Copy link
Author

AxiomeCG commented Jan 31, 2024

is it ready @AxiomeCG ?

@drcmda I put it in draft as mentioned in the template of the issue, but to me it is done ! :)

@AxiomeCG AxiomeCG marked this pull request as ready for review January 31, 2024 09:35
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.

PerformanceMonitor's onFallback gets called when it's not flip-flopping
2 participants