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
{{ message }}
Repository navigation
[performance][memory] String copy on hot path #3477
clientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsperformance
getString of the binary format readers sends the value of a String column through DataTypeConverter.stringToString. The method made a StringBuilder, copied the text into it and made a new String from it: three allocations and two copies for each call. For a column that is not an array the result is equal to the text that the method started with.
This PR changes stringToString so that it finds the text first and makes a StringBuilder, with the correct size, only when it adds the quotes for an array column.
A String value is returned as it is.
A StringValue (the client reads strings as raw bytes) gives the String that the StringValue keeps.
A CharSequence, a byte[] and other objects are converted one time, without the StringBuilder.
The quoted form for an array column is the same text as before.
clientModule: the client (client-v2; with legacy: the v1 client)data-typesArea: type names, value encoding and decoding, row mapping, data formatsperformance
Activity