zhouyan opened a new issue, #41541:
URL: https://github.com/apache/arrow/issues/41541

   ### Describe the bug, including details regarding any error messages, 
version, and platform.
   
   It is not quite clear to me why it is the case yet, but by some try and 
error, the following single line:
   
   
https://github.com/apache/arrow/blob/main/go/parquet/internal/utils/bit_writer.go#L94
   
   Introduced in v14 is causing as much as 10x slow down in some of my 
applications. I will try to reproduce the problem with some minimal working 
example. But in my experiment with real-world applications so far, it seems the 
use of `Reserve` here is incorrect.
   
   1. `PooledBufferWriter` already does necessary reserve when it need to
   2. In Arrow `Reserve` reserve additional bytes, not a new capacity, unlike 
in the usual C++ STL semantics.
   3. In profiling, 90% of time is spent in memory allocation rooted in this 
Reserve call. Removing it I don't see any additional allocation pop up anywhere 
else. It suggests the "reserve" and added allocation calls are unnecessary and 
harmful.
   
   ### Component(s)
   
   Go, Parquet


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