[ 
https://issues.apache.org/jira/browse/TEZ-4762?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Denys Kuzmenko updated TEZ-4762:
--------------------------------
    Description: 
*Problem*                                                                       
                                                                                
                                               
                                                                                
                                                                                
                                                 
  UnorderedPartitionedKVWriter opens an IFile.Writer per partition on every 
spill (SpillCallable), in the final merge and for large records. For Snappy and 
LZ4, each writer goes through                        
  CodecUtils.createOutputStream -> codec.createOutputStream(out, compressor), 
which                                                                           
                                                   
  * reads io.compression.codec.\{snappy,lz4\}.buffersize from the Configuration 
(Integer.parseInt of the string value on every call, under the codec's conf 
lock), and                                           
  * builds a BlockCompressorStream that allocates and zeroes a 256 KiB buffer 
plus the compressed buffer (bufferSize/6+32 for Snappy, bufferSize/255+16 for 
LZ4).                                                
                                                                                
                                                                                
                                                 
  IFile.Writer also allocates a 64 KiB write buffer (TEZ-4760). With many 
partitions, each holding a few KB per spill, that is ~330 KB allocated and 
zeroed per partition to write a few KB.                     
                                                                                
                                                                                
                                                 
  *Profile* (Hive LLAP, TPC-DS 10 TB, 12 x r6id.4xlarge, async-profiler CPU 
samples of all LLAP daemons over one query run)                                 
                                                     
                                                                                
                                                                                
                                                 
  ||Frames under IFile.Writer setup (all from SpillCallable)||q75||q64||        
                                                                                
                                                 
  |Configuration.getInt -> Integer.parseInt|1.53 %|1.48 %|                      
                                                                                
                                                 
  |codec stream buffers (allocate + zero)|0.90 %|1.19 %|                        
                                                                                
                                                 
  |IFile write buffer|0.10 %|0.17 %|                                            
                                                                                
                                                 
  |CodecPool.getCompressor, header write (unchanged)|0.66 %|0.66 %|             
                                                                                
                                                 
  |*total*|*3.19 %*|*3.50 %*|                                                   
          



> UnorderedPartitionedKVWriter: size each partition's codec stream to the 
> partition
> ---------------------------------------------------------------------------------
>
>                 Key: TEZ-4762
>                 URL: https://issues.apache.org/jira/browse/TEZ-4762
>             Project: Apache Tez
>          Issue Type: Improvement
>            Reporter: Denys Kuzmenko
>            Priority: Major
>
> *Problem*                                                                     
>                                                                               
>                                                    
>                                                                               
>                                                                               
>                                                      
>   UnorderedPartitionedKVWriter opens an IFile.Writer per partition on every 
> spill (SpillCallable), in the final merge and for large records. For Snappy 
> and LZ4, each writer goes through                        
>   CodecUtils.createOutputStream -> codec.createOutputStream(out, compressor), 
> which                                                                         
>                                                      
>   * reads io.compression.codec.\{snappy,lz4\}.buffersize from the 
> Configuration (Integer.parseInt of the string value on every call, under the 
> codec's conf lock), and                                           
>   * builds a BlockCompressorStream that allocates and zeroes a 256 KiB buffer 
> plus the compressed buffer (bufferSize/6+32 for Snappy, bufferSize/255+16 for 
> LZ4).                                                
>                                                                               
>                                                                               
>                                                      
>   IFile.Writer also allocates a 64 KiB write buffer (TEZ-4760). With many 
> partitions, each holding a few KB per spill, that is ~330 KB allocated and 
> zeroed per partition to write a few KB.                     
>                                                                               
>                                                                               
>                                                      
>   *Profile* (Hive LLAP, TPC-DS 10 TB, 12 x r6id.4xlarge, async-profiler CPU 
> samples of all LLAP daemons over one query run)                               
>                                                        
>                                                                               
>                                                                               
>                                                      
>   ||Frames under IFile.Writer setup (all from SpillCallable)||q75||q64||      
>                                                                               
>                                                      
>   |Configuration.getInt -> Integer.parseInt|1.53 %|1.48 %|                    
>                                                                               
>                                                      
>   |codec stream buffers (allocate + zero)|0.90 %|1.19 %|                      
>                                                                               
>                                                      
>   |IFile write buffer|0.10 %|0.17 %|                                          
>                                                                               
>                                                      
>   |CodecPool.getCompressor, header write (unchanged)|0.66 %|0.66 %|           
>                                                                               
>                                                      
>   |*total*|*3.19 %*|*3.50 %*|                                                 
>             



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to