Skip to content

Use streaming JSON parser for profile fetch#5843

Open
pepyakin wants to merge 2 commits intofirefox-devtools:mainfrom
pepyakin:pep/streaming-json-parser
Open

Use streaming JSON parser for profile fetch#5843
pepyakin wants to merge 2 commits intofirefox-devtools:mainfrom
pepyakin:pep/streaming-json-parser

Conversation

@pepyakin
Copy link

When using samply with large profiles you can sometimes get very large profiles. If an uncompressed profile gets large enough it will get silently truncated and the profile cannot be displayed (see the screenshot attached). As was noted by @mhansen, it's probably the String limit as described here.

In any case, this PR attempts to fix this issue by using a streaming JSON parser instead of trying to swallow the trace awhole.

image

@pepyakin pepyakin requested a review from canova as a code owner February 16, 2026 12:55
@pepyakin
Copy link
Author

Hey there @canova . Is there anything I can do to help pushing this in?

@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

❌ Patch coverage is 81.92771% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.55%. Comparing base (c0b82be) to head (b6166ba).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
src/actions/receive-profile.ts 81.92% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5843      +/-   ##
==========================================
- Coverage   85.56%   85.55%   -0.01%     
==========================================
  Files         319      319              
  Lines       31411    31494      +83     
  Branches     8670     8588      -82     
==========================================
+ Hits        26876    26944      +68     
- Misses       4104     4119      +15     
  Partials      431      431              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mstange
Copy link
Contributor

mstange commented Mar 3, 2026

I haven't looked in any detail yet, but I tried the deploy preview with a large-but-not-too-large profile and I still see the old path being used: https://deploy-preview-5578--perf-html.netlify.app/public/fkmw9djz29ntsmaznezy93hhft85jy0zjrp5my8/calltree/?globalTrackOrder=0&profileName=FullSp3Firefox-15x-symbolicated&thread=0&v=12

Is this expected? I would like to compare the performance.

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