Skip to content

[RUM-18282] Add native profiling benchmark scenario - #1471

Open
sbarrio wants to merge 4 commits into
sbarrio/RUM-18282/expose-native-profilersfrom
sbarrio/RUM-18282/add-profiling-scenario-to-benchmark-app
Open

sbarrio wants to merge 4 commits into
sbarrio/RUM-18282/expose-native-profilersfrom
sbarrio/RUM-18282/add-profiling-scenario-to-benchmark-app

Conversation

@sbarrio

@sbarrio sbarrio commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

It adds a new profiling scenario to the benchmark app. Allowing benchmark runs that enable the Profiling module and configure the native iOS/Android profilers. It then offers 3 stress test buttons to create CPU work for the test to send profiles.

Motivation

We should be able to monitor the performance impact of the profiling module.

Additional notes

Simulator Screenshot - iPhone 17 - 2026-10-05 at 10 55 27 Screenshot_1791190562

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)
  • If this PR is auto-generated, please make sure also to manually update the code related to the change

@datadog-official

datadog-official Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7045fe6 | Docs | View more details | Give us feedback!

@sbarrio sbarrio added the Do not merge This PR is not ready to be merged yet label Oct 5, 2026
@sbarrio sbarrio changed the title [RUM-18281] Add native profiling benchmark scenario [RUM-18282] Add native profiling benchmark scenario Oct 5, 2026
@sbarrio
sbarrio marked this pull request as ready for review October 5, 2026 13:19
@sbarrio
sbarrio requested review from a team as code owners October 5, 2026 13:19
@sbarrio sbarrio removed the Do not merge This PR is not ready to be merged yet label Oct 16, 2026
@sbarrio
sbarrio force-pushed the sbarrio/RUM-18282/add-profiling-scenario-to-benchmark-app branch from 7738127 to ffe1dce Compare October 16, 2026 10:01
@jeff-morgan-dd jeff-morgan-dd self-assigned this Oct 16, 2026
Comment thread benchmarks/README.md Outdated
Comment thread benchmarks/README.md Outdated
@sbarrio
sbarrio force-pushed the sbarrio/RUM-18282/add-profiling-scenario-to-benchmark-app branch from ffe1dce to b1e0dc8 Compare October 27, 2026 13:46
@sbarrio
sbarrio force-pushed the sbarrio/RUM-18282/add-profiling-scenario-to-benchmark-app branch from b1e0dc8 to 7641d9c Compare October 27, 2026 13:53
@sbarrio
sbarrio added this pull request to stack #1517 October 27, 2026 13:57
Co-authored-by: jeff-morgan-dd <jeff.morgan@datadoghq.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 13:58
Co-authored-by: jeff-morgan-dd <jeff.morgan@datadoghq.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Credential logging and unresolved RUM view, initialization, and busy-state issues compromise secure and reliable profiling runs.

4 open issues
What changed in this PR

Adds a native profiling scenario to the benchmark app to measure profiling overhead on iOS and Android.

Changes:

  • Adds a profiling run type, scenario routing, and native profiling dependencies.
  • Provides sorting, Fibonacci, prime-counting, and JS long-task workloads.
  • Enables JS long-task reporting and documents profiling launch commands.
File Description
yarn.lock Records the benchmark profiling dependency.
benchmarks/​src/​testSetup/​types/​testConfig.ts Defines the profiling scenario and native-profiling run type.
benchmarks/​src/​testSetup/​testUtils.ts Enables JS long-task reporting at 200 ms.
benchmarks/​src/​scenario/​Profiling/​types.ts Defines profiling scenario props.
benchmarks/​src/​scenario/​Profiling/​profilingUtils.ts Adds CPU-intensive workload helpers.
benchmarks/​src/​scenario/​Profiling/​profilingScenario.tsx Adds profiler setup, workload controls, and timing results.
benchmarks/​src/​App.tsx Routes the profiling scenario.
benchmarks/​README.md Documents launch commands and Android requirements.
benchmarks/​package.json Adds the profiling workspace dependency.
benchmarks/​ios/​Podfile.lock Records native iOS profiling pods.

Review effort: Balanced

const [lastResult, setLastResult] = useState<string>('');

useEffect(() => {
console.log(props.testConfig);
Comment on lines +42 to +43
instrument().then(async () => {
if (runType === RunType.INSTRUMENTED_PROFILING_NATIVE) {
Comment on lines +45 to +48
await DdProfiling.enable({
applicationLaunchSampleRate: 100,
continuousSampleRate: 100,
});
Comment on lines +58 to +63
const startTime = performance.now();
work();
const durationMs = performance.now() - startTime;

setLastResult(`${label} took ${durationMs.toFixed(0)}ms`);
setIsRunning(false);

This branch has not been deployed

No deployments
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.

3 participants