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

   ### Describe the enhancement requested
   
   ```python
   import random
   import array
   import numpy as np
   import pyarrow as pa
   x = array.array("B", [random.randint(0, 255) for i in range(50000)])
   ```
   
   `%timeit pa.array(x, pa.uint8())`:  2.5 ms ± 64 µs per loop (mean ± std. 
dev. of 7 runs, 100 loops each)
   `%timeit pa.array(np.asarray(x), pa.uint8())`: 6.79 µs ± 45.4 ns per loop 
(mean ± std. dev. of 7 runs, 100,000 loops each)
   
   Converting to a numpy array gives a 350x speedup. `array.array` isn't 
commonly used but it is part of the Python standard library, so should probably 
be supported by `pa.array`.
   
   ### Component(s)
   
   Python


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