If MySqlParameter.Value is set to a StringBuilder instance (#975) and MySqlCommand.Prepare() is called, the code currently calls StringBuilder.ToString() and writes it as a length-encoded UTF-8 string.
In .NET 5.0, it should be more performant to use GetChunks:
loop over the chunks and sum the results of GetByteCount (for a UTF8Encoder) calculate the total length of the UTF-8 string
- write the length prefix
- loop over the chunks and write each out (encoding each one into UTF-8)
If
MySqlParameter.Valueis set to aStringBuilderinstance (#975) andMySqlCommand.Prepare()is called, the code currently callsStringBuilder.ToString()and writes it as a length-encoded UTF-8 string.In .NET 5.0, it should be more performant to use
GetChunks:loop over the chunks and sum the results ofcalculate the total length of the UTF-8 stringGetByteCount(for aUTF8Encoder)