[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
treex:api-implementation [2015/12/08 21:31]
popel
treex:api-implementation [2015/12/09 15:04]
popel
Line 23: Line 23:
 Když dám stringy/inty do hashe (místo do pole), tak je to taky 64/32 bajtů, jen je tam samozřejmě ještě nějaká režie na ten hash. Viz Když dám stringy/inty do hashe (místo do pole), tak je to taky 64/32 bajtů, jen je tam samozřejmě ještě nějaká režie na ten hash. Viz
  
- perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$s} 1..1_000_000}' # string 128M +  perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$s} 1..1_000_000}' # string 128M 
- perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$_} 1..1_000_000}' # int     96M +  perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$_} 1..1_000_000}' # int     96M 
- perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>\$s} 1..1_000_000}'# ref     96M+  perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>\$s} 1..1_000_000}'# ref     96M
  
 Reference zabírá stejně jako int. Reference zabírá stejně jako int.
Line 36: Line 36:
 Je dobré testovat i celkovou paměť virtuální i resident: Je dobré testovat i celkovou paměť virtuální i resident:
  
- perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$_} 1..1_000_000}; system "ps -ovsz,rss,size $$"' +  perl -MDevel::Size=:all -E 'my $s="s"; say total_size {map {$_=>$_} 1..1_000_000}; system "ps -ovsz,rss,size $$"' 
- 96277560+  96277560
     VSZ   RSS  SIZE     VSZ   RSS  SIZE
- 292780 271456 270416+  292780 271456 270416
  
 Zde je vidět, že Devel::Size::total_size hlásí 96MB, ale ps hlásí 292MB. Zde je vidět, že Devel::Size::total_size hlásí 96MB, ale ps hlásí 292MB.
 +
 +==== Benchmark Perlích accessorů ====
 +  LV V::Magic H        61697/    
 +  LV V::Magic A        68770/    
 +  LV Sentinel H       163699/    
 +  LV Sentinel A       168137/    
 +  Moose              1155539/    
 +  object H           1219345/    
 +  object A           1237085/    
 +  LV C::XSAccessor H 2832477/    
 +  LV C::XSAccessor A 2868345/    
 +  Mouse              3385568/    
 +  Moo                3698192/    
 +  Moops              3775721/    
 +  C::XSAccessor H    3840348/    
 +  O::Tiny::RW::XS    3873005/    
 +  C::XSAccessor A    3881987/    
 +  hash               5248761/    
 +  array              5718062/    
 +

[ Back to the navigation ] [ Back to the content ]