Mryange opened a new pull request, #70252:
URL: https://github.com/apache/doris/pull/70252
### What problem does this PR solve?
Issue Number: N/A
Problem Summary:
Improve numeric-to-string conversion performance by resizing offsets once
per batch and appending formatted values directly to the character buffer,
avoiding per-row `BufferWritable::commit()` overhead. Preserve existing
formatting and reuse the type-specific character reservation sizes.
Earlier ARM measurements of this batch-writing approach (10 million rows,
median of 10 hot runs):
| Input | Before (ms) | After (ms) | Time reduction |
| --- | ---: | ---: | ---: |
| INT, all -1 | 114.31 | 79.72 | 30.3% |
| INT, mixed | 121.09 | 84.47 | 30.2% |
| SMALLINT, mixed | 108.41 | 76.63 | 29.3% |
| BIGINT, long values | 202.91 | 166.86 | 17.8% |
These measurements used an earlier integer-only experiment with a
72-byte-per-row reservation. This PR uses `CastToString::string_length<T>` and
extends the shared batch path to all supported types; the final patch has not
been benchmarked.
### Release note
Improve performance of numeric-to-string conversions.
### Check List (For Author)
- Test
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test
clang-format 16, `git diff --check`, and
`build-support/check-build-hygiene.sh` passed. The earlier ARM experiment was
built and tested; this final patch has not been built or run through
unit/regression tests.
- Behavior changed:
- [x] No.
- [ ] Yes.
- Does this need documentation?
- [x] No.
- [ ] Yes.
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]