designcourse icon indicating copy to clipboard operation
designcourse copied to clipboard

Support RUM work on Web-Worker

Open miridih-chyoon opened this issue 1 year ago • 1 comments
trafficstars

Hello,

In our project, moving GA-related operations to WebWorker has resulted in many performance improvements. Datadog's RUM also seems to be using a lot of resources in the browser. Is it possible to improve the RUM or logging related logic to work in WebWorker? In Next.js, we use Partytown to make GTM work with Web-Worker, which improves performance.

miridih-chyoon avatar Aug 26 '24 00:08 miridih-chyoon

Hello,

The RUM Browser SDK collects a lot of data from APIs only available in the main thread global scope. Running the whole SDK inside a WebWorker would not work.

That being said, the SDK is already running some code in a Web Worker to avoid impacting the main thread for some operations.

Did you observe any specific part of the RUM SDK that "uses a lot of resources"? If you can share a Chrome profile we might be able to investigate and improve it.

BenoitZugmeyer avatar Aug 27 '24 13:08 BenoitZugmeyer