Skip to content

Conversation

@ryantrem
Copy link
Member

@ryantrem ryantrem commented Nov 14, 2025

This PR depends on microsoft/arcana.cpp#51

  • Add a public PerfTrace API that aims to provide a platform agnostic way of capturing perf intervals (just wraps arcana's trace_region). The API can be used purely on the native side, but it also includes helper functions for transferring ownership to JS, or taking ownership from JS. This makes it easy to get perf intervals for operations that start in native and end in JS, or vice versa.
  • Also add a little more tracing to XmlHttpRequest.

Add some more tracing in XmlHttpRequest
@ryantrem ryantrem requested review from bghgary and Copilot November 14, 2025 03:14
Copilot finished reviewing on behalf of ryantrem November 14, 2025 03:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a platform-agnostic PerfTrace API that wraps arcana's trace_region functionality and integrates performance tracing into XMLHttpRequest operations. The implementation depends on updates to the upstream arcana.cpp library.

  • Introduces a new PerfTrace API with configurable trace levels and handle management
  • Adds performance tracing to XMLHttpRequest's Send and RaiseEvent methods
  • Updates CMake configuration to link Foundation library with required dependencies

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
Core/Foundation/Include/Babylon/PerfTrace.h Declares the public PerfTrace API with Level enum and Handle class
Core/Foundation/Source/PerfTrace.cpp Implements PerfTrace API with arcana trace_region wrapping and Napi interop
Core/Foundation/CMakeLists.txt Adds PerfTrace files and links Foundation with napi and arcana dependencies
Polyfills/XMLHttpRequest/Source/XMLHttpRequest.h Adds m_url member to store URL for tracing purposes
Polyfills/XMLHttpRequest/Source/XMLHttpRequest.cpp Integrates tracing into Send and RaiseEvent operations
CMakeLists.txt Updates arcana.cpp dependency to personal fork with tracing support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ryantrem ryantrem marked this pull request as ready for review November 14, 2025 17:27
@ryantrem ryantrem requested a review from bghgary November 14, 2025 17:46
@ryantrem ryantrem enabled auto-merge (squash) November 14, 2025 17:59
@ryantrem ryantrem merged commit 76f2c8f into BabylonJS:main Nov 14, 2025
19 checks passed
ryantrem added a commit to BabylonJS/BabylonNative that referenced this pull request Nov 15, 2025
…JsRuntime's Foundation lib (#1569)

This PR depends on BabylonJS/JsRuntimeHost#125

- Rework NativeTracing to be build on top of the new PerfTrace helper
from JsRuntime's Foundation lib.
- Add NativeTracing to the iOS app (the platform tracing is currently
implemented for).
- Add a commented out line in experience.js that enables tracing through
the Babylon.js API.
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.

2 participants