cyb70289 commented on issue #13787:
URL: https://github.com/apache/arrow/issues/13787#issuecomment-1207633172

   ```python
   import numpy as np
   import pyarrow as pa
   import time
   import os
   
   data = np.ones((1, 1, 544, 192), dtype=np.float32)
   
   tensor = pa.Tensor.from_numpy(data)
   
   path = os.path.join(str("/dev/shm/"), 'pyarrow-tensor-ipc-roundtrip')
   mmap = pa.create_memory_map(path, 5000000 * 1000)
   
   s = time.time()
   for i in range(1000):
       result = pa.ipc.write_tensor(tensor, mmap)
   e = time.time()
   
   print(e - s)
   
   #output_stream = pa.BufferOutputStream()
   #
   #s = time.time()
   #for i in range(1000):
   #    result = pa.ipc.write_tensor(tensor, output_stream)
   #e = time.time()
   #
   #print(e - s)
   ```


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