fix: avoid O(N) memory allocation when displaying large binary blobs in result panel#4876
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4876 +/- ##
============================================
- Coverage 46.68% 44.01% -2.68%
- Complexity 2150 2151 +1
============================================
Files 843 957 +114
Lines 27322 34051 +6729
Branches 2533 3753 +1220
============================================
+ Hits 12756 14986 +2230
- Misses 13791 18312 +4521
+ Partials 775 753 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Yicong-Huang
approved these changes
May 3, 2026
Contributor
Yicong-Huang
left a comment
There was a problem hiding this comment.
LGTM. One question inline.
Contributor
|
we had an offline discussion, the backend optimization is good. but for frontend, maybe better to display non-HEX. here is a suggested format:
|
… into chris-fix-table-scan
Contributor
|
looks good! |
Contributor
|
Great job! |
Contributor
|
forgot to ask, does this need to be back ported to release/1.1? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
When running a workflow that produces large binary fields (e.g. 50 MB blobs), the result panel appeared empty with no error messages. The root cause was that
ExecutionResultServiceconverted the entire byte array to a hex string (~3× the blob size in memory) before truncating it for display, causing the web server to take a very long time to fetch results.The fix slices the byte array to only the bytes needed for the preview before encoding, making the conversion O(1) regardless of blob size. The display format is also updated from a hex dump (AB 12 CD...) to a binary string preview (<binary 0110100101...110, size = 52,428,800 bytes>), showing binaryPreviewLeadingBits (10) leading bits and binaryPreviewTrailingBits (3) trailing bits, just more clearly signaling opaque binary content.
Performance comparison (50 MB blob, averaged over 5 runs):
~1,000,000× faster for a 50 MB blob; effectively constant time regardless of blob size.
Any related issues, documentation, discussions?
Closes #4875
How was this PR tested?
Test by running this workflow and check if the result appears almost immediately
Untitled workflow (11).json
Was this PR authored or co-authored using generative AI tooling?
Claude Code