andygrove opened a new pull request, #2996:
URL: https://github.com/apache/datafusion-comet/pull/2996
## Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases. You can
link an issue to this PR using the GitHub syntax. For example `Closes #123`
indicates that this PR will close issue #123.
-->
Closes #.
## Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in
the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your
changes and offer better suggestions for fixes.
-->
Sub-day truncations (MICROSECOND, MILLISECOND, SECOND, MINUTE, HOUR) are
timezone-independent - truncating to the minute boundary is the same regardless
of timezone display. This allows simple integer arithmetic instead of expensive
DateTime conversions.
### Sub-day Formats (Optimized with Arithmetic)
| Format | Before | After | Speedup |
|-------------|--------|-------|---------------------------------|
| HOUR | 957 µs | 32 µs | ~30x faster (96.6% improvement) |
| MINUTE | 640 µs | 32 µs | ~20x faster (95% improvement) |
| SECOND | 405 µs | 32 µs | ~12x faster (92% improvement) |
| MILLISECOND | 430 µs | 32 µs | ~13x faster (92.6% improvement) |
| MICROSECOND | 435 µs | 27 µs | ~16x faster (93.7% improvement) |
### Non-UTC Timezone (America/New_York)
| Format | Before | After | Speedup |
|--------|--------|-------|---------------------------------|
| SECOND | 598 µs | 35 µs | ~17x faster (94.2% improvement) |
## What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is
sometimes worth providing a summary of the individual changes in this PR.
-->
## How are these changes tested?
<!--
We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code
If tests are not included in your PR, please explain why (for example, are
they covered by existing tests)?
-->
--
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]