HappenLee commented on PR #67382:
URL: https://github.com/apache/doris/pull/67382#issuecomment-5554065345

   Two non-blocking simplification suggestions:
   
   1. **Reuse the PORT suffix extraction in FE.** In 
`StringArithmetic.parseUrlPort()`, the new IPv6 branch duplicates the existing 
`portStart -> find terminator -> substringEnd` logic. Could the IPv6 and 
non-IPv6 branches only determine the port separator position, then share the 
suffix extraction below? The BE implementation already largely follows this 
structure. This would reduce duplication and keep future changes to port 
termination rules in one place.
      
https://github.com/apache/doris/blob/dd05c8ee9148c175fc172234ef61c436fc258505/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/executable/StringArithmetic.java#L1054-L1075
   
   2. **Avoid the unused colon lookup in the BE IPv6 path.** 
`_s_colon_search.search(&host_start)` runs before checking for `[`, but the 
IPv6 branch immediately overwrites `end_pos` with 
`find_ipv6_host_end(host_start)`. Could the colon lookup move into the non-IPv6 
`else` branch? This removes a redundant lookup for IPv6 inputs; it is a small 
cleanup, not a claim of a significant performance improvement.
      
https://github.com/apache/doris/blob/dd05c8ee9148c175fc172234ef61c436fc258505/be/src/util/url_parser.cpp#L215-L225


-- 
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]

Reply via email to