³ò
{'ïMc           @   s¤   d  Z  d d k Td d k Td d k l Z d d k l Z d d k Z d d k Z d d k Z d d k	 Z	 d d k
 l Z d d k l Z d e f d	 „  ƒ  YZ d S(
   s&   Performance data streaming performanceiÿÿÿÿ(   t   *(   t
   bin_to_hex(   t   timeN(   t   make_memory_file(   t   TestBigRepoRt   TestObjDBPerformancec           B   s/   e  Z d Z d	 Z e d d e ƒd „  ƒ Z RS(
   iè  i
   i   t   HEADt   barec      
   C   sÁ  t  t i i | i d ƒ ƒ } xœt d ƒ D]Ž} | o d p d } t i d | IJt ƒ  } t	 |  i
 | ƒ \ } } t ƒ  | } t i d | IJt ƒ  } | i t d | | ƒ ƒ i }	 t ƒ  | }
 | i |	 ƒ p t ‚ | i t |	 ƒ ƒ } t i i | ƒ d } | d } t i d	 | | | |
 | |
 f IJt ƒ  } | i |	 ƒ } | i ƒ  } t ƒ  | } | i d
 ƒ | | i ƒ  j p t ‚ t i d | | | | | f IJd } t ƒ  } t ƒ  } | i |	 ƒ } x@ t o8 | i | ƒ } | i | ƒ t | ƒ | j  o PqÜqÜWt ƒ  | } | i d
 ƒ d i | ƒ | i ƒ  j p t ‚ | d } t i d | | | | | | f IJt i | ƒ | i i d d d t d t i ƒ} | i ƒ  } t ƒ  } | i  i! | ƒ | i  i" ƒ  | i# i ƒ  i$ ƒ  } | i% ƒ  t ƒ  | } ~ | t |	 ƒ j p t ‚ t i i | ƒ d } t i d | | | | | | f IJt i d d |
 | d | f IJt ƒ  } | i i& | ƒ \ } } } } t ƒ  | } t i d | | | | | f IJt i d d | | d | f IJt ƒ  } | i i' | ƒ \ } } } } x3 t o+ | i | ƒ } t | ƒ | j  o Pq2q2Wt ƒ  | } t i d | | | | | | f IJt i d d | | d | f IJq+ Wd  S(   Nt   objectsi   s   random t    s   Creating %s data ...s   Done (in %f s)t   blobiè  sT   Added %i KiB (filesize = %i KiB) of %s data to loose odb in %f s ( %f Write KiB / s)i    sH   Read %i KiB of %s data at once from loose odb in %f s ( %f Read KiB / s)i   sQ   Read %i KiB of %s data in %i KiB chunks from loose odb in %f s ( %f Read KiB / s)s   -ws   --stdint
   as_processt   istreams`   Added %i KiB (filesize = %i KiB) of %s data to using git-hash-object in %f s ( %f Write KiB / s)s<   Git-Python is %f %% faster than git when adding big %s filesg      Y@id   sL   Read %i KiB of %s data at once using git-cat-file in %f s ( %f Read KiB / s)s<   Git-Python is %f %% faster than git when reading big %sfilessT   Read %i KiB of %s data in %i KiB chunks from git-cat-file in %f s ( %f Read KiB / s)sG   Git-Python is %f %% faster than git when reading big %s files in chunksi Ð ((   t   LooseObjectDBt   ost   patht   joint   git_dirt   ranget   syst   stderrR   R   t   large_data_size_bytest   storet   IStreamt   binshat
   has_objectt   AssertionErrort   readable_db_object_pathR   t   getsizet   streamt   readt   seekt   getvaluet   listt   Truet   appendt   lent   removet   gitt   hash_objectt
   subprocesst   PIPEt   stdint   writet   closet   stdoutt   stript   waitt   get_object_datat   stream_object_data(   t   selft   rwrepot   ldbt	   randomizet   desct   stt   sizeR   t   elapsedR   t   elapsed_addt   db_filet	   fsize_kibt   size_kibt   ostreamt   shadatat   elapsed_readallt   cst   chunkst   datat   elapsed_readchunkst   cs_kibt   proct   gitshat   gelapsed_addt   st   tt   gelapsed_readallt   gelapsed_readchunks(    (    sF   /home/byron/projects/git-python03/git/test/performance/test_streams.pyt   test_large_data_streaming   sˆ     		
$	!		 
#
$$	
$#	!#	 
$i@B i€–˜ i@B i@B (   t   __name__t
   __module__R   t   moderate_data_size_bytest   with_rw_repoR"   RM   (    (    (    sF   /home/byron/projects/git-python03/git/test/performance/test_streams.pyR      s   (   t   __doc__t   git.test.libt   gitdbt
   gitdb.utilR   R   R   R   t   statR(   t   gitdb.test.libR   t   libR   R   (    (    (    sF   /home/byron/projects/git-python03/git/test/performance/test_streams.pys   <module>   s   

