uros-b commented on PR #58667:
URL: https://github.com/apache/spark/pull/58667#issuecomment-5774651313

   I'm not entirely convinced that this can be strongly justified as a 
standalone performance improvement.
   
   - `toUpperCase` / `toLowerCase` never call `numChars()`. They only call 
`isFullAscii()`, which still uses `getIsFullAscii()`. This PR does not make 
case conversion cheaper on a fresh wrapper.
   - Every first `numChars()` now does an extra per-code-point AND plus a 
second volatile store. `LENGTH`, CHAR/VARCHAR write-side checks, split, and 
Levenshtein pay that and never read the flag.
   - `UnsafeRow.getUTF8String` builds a new wrapper every time, so the cache 
only helps if the same instance is reused. On master that is essentially 
UTF8_LCASE `indexOf` (pattern.numChars then pattern.isFullAscii). The locate 
fast-paths in SPARK-59379 / #58668 are the actual consumer (negative-start 
`SUBSTR`, `getChar` after a count). Positive `SUBSTR` does not call 
`numChars()`, so even that pair leaves the common case cold.
   
   A `LENGTH` vs negative `SUBSTR` microbench would make the tax/benefit 
explicit; without that, the ROI is speculative.


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