Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
readyset-psql: Eliminate
row
module and associated inefficiencies
The `row` module contained a bunch of custom iterator code, but it all seems fairly extraneous since it's only used in one place, and that place can be rewritten to use simple primitives like `map()` and `zip()` without losing any clarity or even increasing the lines-of-code count. Additionally, RowIterator called `clone()` on both the DfValue and the Type in its `next()` implementation, which seems wasteful and unnecessary. I'm not sure of the best way to measure the impact here, but cloning every single value in every cached result seems likely to make a significant difference in at least some cases. (Even if it makes no performance difference, though, it still seems worth it to simplify the code and eliminate the extra 100+ lines of boilerplate.) In the case of DfValue, we now just move it into TypedDfValue without cloning it; in the case of Type, we can't move it out of the Arc that it's behind, but I was able to easily adapt the existing code to pass the Type values by reference instead. Release-Note-Core: Improved performance of Postgres cached query response encoding by avoiding an unnecessary copy of the results in memory. Change-Id: I82e12796fcd395ecbb59073297c47057042cc8cc Reviewed-on: https://gerrit.readyset.name/c/readyset/+/5555 Tested-by: Buildkite CI Reviewed-by: Aspen Smith <aspen@readyset.io>
- Loading branch information
1 parent
ca7ef7d
commit e662a9d
Showing
4 changed files
with
64 additions
and
177 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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