You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/11/04 02:09:00 UTC

[GitHub] [orc] guiyanakuang commented on a change in pull request #958: ORC-1041: Fix the implementation of copy data blocks during LZO decompression

guiyanakuang commented on a change in pull request #958:
URL: https://github.com/apache/orc/pull/958#discussion_r742480546



##########
File path: c++/src/LzoDecompressor.cc
##########
@@ -312,13 +312,11 @@ namespace orc {
               output += SIZE_OF_INT;
               matchAddress += increment32;
 
-              *reinterpret_cast<int32_t*>(output) =
-                *reinterpret_cast<int32_t*>(matchAddress);
+              memcpy(output, matchAddress, SIZE_OF_INT);

Review comment:
       > The combination of `reinterpret_cast` + `assignment` looks cheaper than `memcpy` function invocation. I'm wondering if we need to pay some performance penalty here.
   
   I'll do some performance tests later, `repeat_cast` + `assignment` makes direct use of registers, `memcpy` is usually used for larger copies of data, I'm not sure if it's lossy yet
   




-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org