Skip to content

feat: improve profiler performance#332

Open
edusperoni wants to merge 8 commits intomainfrom
feat/better-inspector-and-profiling
Open

feat: improve profiler performance#332
edusperoni wants to merge 8 commits intomainfrom
feat/better-inspector-and-profiling

Conversation

@edusperoni
Copy link
Collaborator

@edusperoni edusperoni commented Jan 13, 2026

This improves the profiler by reducing string copying as well as running it all in C++ (no more entering JS to generate the output). As a result, memory is much more stable and performance is improved, allowing you to run long and accurate traces

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 improves profiler performance by migrating trace processing from JavaScript to C++, reducing string copying and improving memory stability for long-running traces.

Changes:

  • Refactored the tracing agent to store traces in C++ instead of processing them in JavaScript
  • Updated inspector interfaces to use const references for better performance
  • Added JSON library (nlohmann/json) to third_party for JSON parsing in C++

Reviewed changes

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

Show a summary per file
File Description
v8ios.xcodeproj/project.pbxproj Added third_party directory to project structure
NativeScript/inspector/ns-v8-tracing-agent-impl.mm Refactored trace writer to use chunked storage and removed JavaScript trace processing
NativeScript/inspector/ns-v8-tracing-agent-impl.h Updated interfaces to return vector of strings and added chunking methods
NativeScript/inspector/JsV8InspectorClient.mm Added JSON parsing for trace configuration and removed JavaScript-based trace processing
NativeScript/inspector/JsV8InspectorClient.h Updated method signatures to use const references
NativeScript/inspector/InspectorServer.mm Updated method signatures to use const references
NativeScript/inspector/InspectorServer.h Updated method signatures to use const references
.clang-format-ignore Added third_party directory to format ignore list
Comments suppressed due to low confidence (1)

NativeScript/inspector/JsV8InspectorClient.mm:1

  • Lambda captures message by value, creating an unnecessary string copy. Since Send takes a const std::string&, the lambda parameter should also be const std::string&: [channel, q](const std::string& message).
#include <Foundation/Foundation.h>

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

@edusperoni edusperoni force-pushed the feat/better-inspector-and-profiling branch from 18f69c1 to b1504bb Compare March 3, 2026 14:41
edusperoni and others added 3 commits March 3, 2026 11:45
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