You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@orc.apache.org by GitBox <gi...@apache.org> on 2022/05/18 03:54:48 UTC

[GitHub] [orc] coderex2522 commented on a diff in pull request #1114: ORC-1170:[C++] Optimize the RowReader::seekToRow function in the case of seeking within the same stripe

coderex2522 commented on code in PR #1114:
URL: https://github.com/apache/orc/pull/1114#discussion_r875444629


##########
c++/include/orc/MemoryPool.hh:
##########
@@ -72,6 +72,10 @@ namespace orc {
       return currentCapacity;
     }
 
+    const T& operator[](uint64_t i) const {
+      return buf[i];
+    }
+

Review Comment:
   I write a simple demo for testing the implement overload that use const function to  implement non-const function. 
   The complex implement(return const_cast<T&>(static_cast<const DataBuffer<T>&>(*this)[i])) will cost twice the overhead of the simple implement(return buf[i]).
   ![simple_demo](https://user-images.githubusercontent.com/13637742/168953847-3beb0994-702b-4239-81da-9512c7d56dff.png)
   



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

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