Bug description
Around the morning of March 20th, I noticed a performance degradation in our Nextjs 16 apps more resource intensive views (our WebGL maps went from smooth 120 FPS to ~25 FPS). Doing a performance profile in Chrome reveals that rrweb consumes ~55% of main thread time (see screenshot). Over ~9 seconds of the profile, there's 443 calls to posthog-recorder.js and 76 of those exceed the 16ms frame budget, averaging ~60ms each (peak 93ms). Hence it's blocking the main thread from other work.
I tried the latest released version (1.363.2) without success and then downgraded to an older version (1.360.2) with the same result. Hence, I hashed the contents of the call to posthog-recorder.js?v=1.360.2 and posthog-recorder.js?v=1.362.0 and realized they're the same which makes me wonder if the version is only used for cache control and I cannot actually fix the issue myself.
MD5 (posthog-recorder.js?v=1.360.2) = 9b63344f134220932e12f151b9faad6c
MD5 (posthog-recorder.js?v=1.362.0) = 9b63344f134220932e12f151b9faad6c
While the trace was done on Chrome, I've received reports that Firefox and Safari behaves the same from a user POV. I have verified that setting disable_session_recording: true fixes the issue.
Full setup in instrumentation-client.ts:
import { posthog } from "posthog-js";
if (process.env.NEXT_PUBLIC_POSTHOG_KEY) {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY, {
api_host: "/ph",
ui_host: "https://eu.i.posthog.com",
defaults: "2026-01-30",
capture_exceptions: true,
debug: process.env.NODE_ENV === "development",
});
}
How to reproduce
- Enable session recording on any type of resource intensive view and check the performance profiler
Related sub-libraries
Additional context
I have a profile JSON file that I can share but it's a large file so can share over email if requested. It's a pretty critical bug as my only option is to disable session recording and hence loosing out screen recordings until this is addressed.
Thank you in advance!
Thank you for your bug report – we love squashing them!
Bug description
Around the morning of March 20th, I noticed a performance degradation in our Nextjs 16 apps more resource intensive views (our WebGL maps went from smooth 120 FPS to ~25 FPS). Doing a performance profile in Chrome reveals that rrweb consumes ~55% of main thread time (see screenshot). Over ~9 seconds of the profile, there's 443 calls to posthog-recorder.js and 76 of those exceed the 16ms frame budget, averaging ~60ms each (peak 93ms). Hence it's blocking the main thread from other work.
I tried the latest released version (1.363.2) without success and then downgraded to an older version (1.360.2) with the same result. Hence, I hashed the contents of the call to posthog-recorder.js?v=1.360.2 and posthog-recorder.js?v=1.362.0 and realized they're the same which makes me wonder if the version is only used for cache control and I cannot actually fix the issue myself.
MD5 (posthog-recorder.js?v=1.360.2) = 9b63344f134220932e12f151b9faad6c
MD5 (posthog-recorder.js?v=1.362.0) = 9b63344f134220932e12f151b9faad6c
While the trace was done on Chrome, I've received reports that Firefox and Safari behaves the same from a user POV. I have verified that setting
disable_session_recording: truefixes the issue.Full setup in
instrumentation-client.ts:How to reproduce
Related sub-libraries
Additional context
I have a profile JSON file that I can share but it's a large file so can share over email if requested. It's a pretty critical bug as my only option is to disable session recording and hence loosing out screen recordings until this is addressed.
Thank you in advance!
Thank you for your bug report – we love squashing them!