You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The depth-aware array-decoding function introduced in #1594 is aware of each leaf node in a deep structure, but decoding is a recursive operation with string input. This means that nested arrays are fully traversed and comprehended, but that information is discarded in the calls that ultimately deserialize their constituent elements.
Description of the Design
The function should instead be provided with an ephemeral cache shared across the call stack of an outermost call to decodePassable, such that the outermost decodeArray function can populate it and reentrant calls can return from it rather than iterating over an already-visited slice of the input string.
Security Considerations
None in particular.
Scaling Considerations
This is only worth pursuing if it actually improves performance, specifically time complexity without an undue degradation of space complexity.
Test Plan
Per the above, we should perform some kind of benchmarking.
Upgrade Considerations
None; this will be a functionality-preserving optimization.
The text was updated successfully, but these errors were encountered:
@gibson042 , does this also apply to compactOrdered? If not, I suggest closing as won't fix. If so, I suggest renaming.
gibson042
changed the title
For performance, decodePassable should minimize reparsing
For performance, compactOrdered decodePassable should minimize reparsing
Mar 18, 2024
Extracted from #1594 (comment)
What is the Problem Being Solved?
The depth-aware array-decoding function introduced in #1594 is aware of each leaf node in a deep structure, but decoding is a recursive operation with string input. This means that nested arrays are fully traversed and comprehended, but that information is discarded in the calls that ultimately deserialize their constituent elements.
Description of the Design
The function should instead be provided with an ephemeral cache shared across the call stack of an outermost call to
decodePassable
, such that the outermost decodeArray function can populate it and reentrant calls can return from it rather than iterating over an already-visited slice of the input string.Security Considerations
None in particular.
Scaling Considerations
This is only worth pursuing if it actually improves performance, specifically time complexity without an undue degradation of space complexity.
Test Plan
Per the above, we should perform some kind of benchmarking.
Upgrade Considerations
None; this will be a functionality-preserving optimization.
The text was updated successfully, but these errors were encountered: