[ 
https://issues.apache.org/jira/browse/ARROW-6926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16978546#comment-16978546
 ] 

Joris Van den Bossche commented on ARROW-6926:
----------------------------------------------

Ah, thanks. But it seems cython is adding a bit more still:

{code}
In [21]: a = pa.array([1]*10)                                                   
                                                                                
                                                   

In [22]: sys.getsizeof(a)                                                       
                                                                                
                                                   
Out[22]: 96

In [23]: object.__sizeof__(a)                                                   
                                                                                
                                                   
Out[23]: 72
{code}

(not sure how much we care about those small numbers, in reality users will 
mainly care for big arrays where the nbytes dominates the result)

> [Python] Support __sizeof__ protocol for Python objects
> -------------------------------------------------------
>
>                 Key: ARROW-6926
>                 URL: https://issues.apache.org/jira/browse/ARROW-6926
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Python
>            Reporter: Matthew Rocklin
>            Priority: Minor
>             Fix For: 1.0.0
>
>
> It would be helpful if PyArrow objects implemented the `__sizeof__` protocol 
> to give other libraries hints about how much data they have allocated.  This 
> helps systems like Dask, which have to make judgements about whether or not 
> something is cheap to move or taking up a large amount of space.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to