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

Paul Rogers commented on DRILL-6596:
------------------------------------

This issue came up in the result set vector code. We found a number of things:

* That when vectors are first allocated, they are not zero-filled.
* Early in Drill's run, memory for the vector will come from the system, and 
will be zero-filled by Unsafe.
* If Drill has run for a while, the memory allocated to the vector will come 
from the free pool and will be garbage-filled.
* When vectors double, the code zero-fills the new half.

Since Drill works even for vectors allocated with garbage in the initial 
allocation, it means Drill does a good job of accurately writing values to 
vectors. Indeed, there is "fill empties" logic to handle this.

As a result, there is never a need for zero-fill (except in the Unit4 "bits" 
vector) at allocation time (new or when doubling).

> Variable length vectors use unnecessary emptyByteArray to fill empties
> ----------------------------------------------------------------------
>
>                 Key: DRILL-6596
>                 URL: https://issues.apache.org/jira/browse/DRILL-6596
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Parth Chandra
>            Priority: Major
>
> When writing to an index beyond the last index written to, Variable Length 
> vectors set the 'empties' by writing a zero length byte array to the indexes 
> that were skipped.
> This is, as it turns out, sometimes an expensive operation, and is completely 
> unnecessary as all that needs to be done is to set the offset vector 
> correctly. 
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to