findepi commented on PR #17583:
URL: https://github.com/apache/datafusion/pull/17583#issuecomment-3299916082

   > a string then `clone` or `to_owned` is likely faster than `to_string` -- 
which goes through `Display` and the whole formatting magic.
   
   to_string, clone and to_owned are equivalent on `&String`, because the 
`ToString` has a specialization
   but what you say is true for `&&String`, as `ToString` somehow lacks 
sepcialization for `&&String`, which is why clippy has a lint for this
   
   BTW what's surprising, given `&String`, the faster way to clone on Mac M4 is 
`.as_str().to_string()`. Only 4% faster, but pretty consistent. 
   
   


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