njnu-seafish commented on PR #18717:
URL: 
https://github.com/apache/dolphinscheduler/pull/18717#issuecomment-6260716996

   @SbloodyS  Thanks for the feedback, agreed — the byte arithmetic effectively 
duplicated the assembly logic, and readers had to keep both in sync to trust 
it. That's real complexity for a rarely-hit path.
   
   Simplified in 5d78eab8: dropped the serializedContentSize formula and the 
running rowsBytes accounting. The budget check now simply assembles the 
candidate content via buildAlertContent and measures its UTF-8 bytes, dropping 
tail rows until it fits — the measured string is exactly what gets returned, so 
there is no separate size formula left to maintain.
   
   The core improvement is kept: each row is still serialized only once (which 
is what #18714 is about); the retry loop just re-joins already-serialized 
strings, so it stays well ahead of dev, where every dropped row re-serialized 
the whole array (measured 1.1–5.5× faster across plain / wide / CJK / overflow 
scenarios).
   
   Tests pass unchanged (38/38), including the exact byte-boundary cases — the 
output stays byte-for-byte identical.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to