perf: skip double deserialization and enable release LTO#315
Open
KENILSHAHH wants to merge 1 commit intoPolymarket:mainfrom
Open
perf: skip double deserialization and enable release LTO#315KENILSHAHH wants to merge 1 commit intoPolymarket:mainfrom
KENILSHAHH wants to merge 1 commit intoPolymarket:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #315 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 32 32
Lines 5167 5168 +1
=======================================
+ Hits 4420 4421 +1
Misses 747 747
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:
|
240dfb2 to
4b9d385
Compare
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.
Summary
serde_json::Valueparsing for HTTP responses whentracingis disabled, cutting deserialization work in half for normal production usageValue::clone()with flatValue::to_string()in the tracing deserialization path, reducing many small heap allocations to a single one[profile.release]withlto = "thin"andcodegen-units = 1to match existing bench profile, enabling cross-crate inlining and more aggressive compileroptimizations for release builds
Note
Medium Risk
Changes the HTTP response deserialization path and
cfggating aroundserde_helpers, which could surface subtle differences in how optional/unknown fields are handled across feature sets. Build/profile changes (release LTO + single codegen unit) may also affect compile times and binary characteristics but not runtime behavior correctness.Overview
Improves runtime and build-time performance for the SDK client.
When
tracingis disabled, the main HTTPrequestpath now deserializes responses directly into the target type instead of first parsing intoserde_json::Value(avoiding a second deserialization pass). Whentracingis enabled, the warning/error logging path indeserialize_with_warningsis updated to avoid deepValuecloning by storing a singleraw_jsonstring and re-parsing only when needed.Adds a
releaseprofile inCargo.tomlto matchbench(lto = "thin",codegen-units = 1) for more aggressive release optimizations.Written by Cursor Bugbot for commit 4b9d385. This will update automatically on new commits. Configure here.