javascript - RequestAnimationFrame behaviour..hows it work? -
i have been playing around requestanimationframe chrome, , wondered how behaves.
when load canvas , draw, steady 60fps. if scroll around using offset click , drag around map, fps drop (as expected)...once stop dragging around map, fps creeps steady 60fps, 1 time again expected.
here how ever i'm wondered if delibrate requestanimationframe. if drag map around until fps drop, drops below 30 extended period of time, 1 time stop dragging, climbs up, time hits 30fps , not go higher. appears if browser decided 30fps perhaps best option.
is delibrately done browser, been trying find out if case. because go 60fps if dont drop below 30fps long.
yes, it's browsers capable of doing. "how it's supposed work" isn't can answer, here.
the reason under hood 100% browser-specific. it's safe yes, browser capable of deciding when should locked 30hz refresh, rather 60hz refresh.
an illustration of why case:
requestanimationframe()
tied page visibility api if vendors want (very true chrome). basically, if page isn't visible, can slow requestanimationframe()
updates downwards few times per sec or pause them altogether.
given knowledge, it's exclusively plausible believe 1 of 2 things happening:
they're intentionally capping @ 30fps, because sense experience more stable there, based on averaged performance info
they're intentionally throttling you, there's bug in scheme (or less lenient math) preventing going 60, after coast has cleared, .and if are using averaged performance data, might part of issue.
either way, @ to the lowest degree mostly-intentional, unanswered question beingness why sticks 30fps. did leave lone 20 or 30 minutes after fact, see if went @ time, afterwards?
javascript performance-testing
No comments:
Post a Comment