adamreeve commented on code in PR #8671:
URL: https://github.com/apache/arrow-rs/pull/8671#discussion_r2446579390


##########
parquet/src/encryption/ciphers.rs:
##########
@@ -50,6 +51,13 @@ impl RingGcmBlockDecryptor {
     }
 }
 
+impl HeapSize for RingGcmBlockDecryptor {
+    fn heap_size(&self) -> usize {
+        // Ring's LessSafeKey doesn't allocate on the heap
+        0

Review Comment:
   I looked into changing `FileDecryptor` to hold a `Vec<u8>` for the footer 
key instead of an `Arc<dyn BlockDecryptor>` to simplify the heap size 
calculation, as mentioned in 
https://github.com/apache/arrow-rs/issues/8472#issuecomment-3387858071. But 
this decreased read speed by about 10% in a small test case, and also increased 
the memory usage.
   
   After looking more closely at the `LessSafeKey` implementation, it doesn't 
appear to hold any heap allocated memory.
   
   I think it's fine to assume the heap size is going to stay zero. The ring 
crate has an `alloc` feature that isn't required for the `aead` module, so it 
would be a big change for this to start allocating.



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

Reply via email to