Attacking with a piercing weapon with absurdly long reach (tested primarily with 10000) causes ticks to freeze until the ray has hit or expired. Aiming this parallel to the horizon such that it does not hit either a block or the build limit can cause ticks to take several seconds. Or if done with perfect accuracy and thousands of range, it can begin to affect memory usage and framerates and leave a world to hang on saving.
To reproduce:
obtain an item with a piercing max_reach in the thousands, such as via /give @s minecraft:stick[minecraft:piercing_weapon={max_reach:10000}]
go to a spot with no obstructing blocks, either above the ground or on a superflat world
Aim horizontally and attack with the weapon, depending on angle tick times may be unaffected, or take tens of seconds, ranges in the hundreds may provide sub-second spikes, if aimed perfectly it may hang the server
The expectation would be that this would be either optimized or more realistically limited so that rays cannot significantly exceed render distance
When aiming above build height there is still a slowdown but it is significantly less pronounced than within buildable space
while waiting for a tick to process, memory allocation rate spikes greatly
Can confirm