Repository navigation
perf(postgres): allocation-light bytea hex and date-only cells (#1529, #1521) - #1615
Merged
Merged
Conversation
…orary strings
postgresByteaHexDisplay made toRadixString(16).padLeft(2, '0') for every byte
(two strings per byte), and date-only cells ran toIso8601String().split('T')
.first, which builds a list for every date cell of every row.
Bytea is written as code units from a hex digit table into one buffer. A date
cell takes the ISO text up to the first T by index, which also keeps the sign
and six digits of years outside 0..9999.
Closes #1529
Closes #1521
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
Both issues are about
postgres_result_cells.dart, so one PR closes both.postgresByteaHexDisplaydidb.toRadixString(16).padLeft(2, '0')per byte (two strings per byte; 20,000 for a 10 KB cell). It now fills oneUint8Listof code units from a0123456789abcdeftable and builds the string once. Output is the same\x+ lower-case hex.toIso8601String().split('T').firstbuilt a list per date cell. The date is now the ISO text up toindexOf('T'). I did not usesubstring(0, 10)or apadLeftformatter as the issues suggest:toIso8601Stringwrites years outside 0..9999 with a sign and six digits (+012000-03-04), and cutting at theTkeeps exactly what the old code returned.Tests (not run locally; CI will)
test/core/database/postgres_result_cells_scanner_test.dart: empty and mixed bytes, all 256 byte values, the cell display path forUint8List, date-only by type OID and by type name (UTC and local), an extended year, and a timestamp that keeps its full text.Closes #1529
Closes #1521