Changeset 29261 for gs2-extensions

Show
Ignore:
Timestamp:
10.09.2014 10:32:54 (5 years ago)
Author:
jmt12
Message:

Removing some of the extraneous IO from high cpu importing... altering the ratio between CPU and IO load appropriately

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/parallel-building/trunk/src/perllib/plugins/CPULoadTextPlugin.pm

    r29161 r29261  
    234234    my $blowfish = new Crypt::Blowfish_PP($key); 
    235235    my $encrypted_text = $blowfish->encrypt($value); 
    236     $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), sprintf("Encrypted%05d", $counter), $encrypted_text); 
     236    if ($self->{'cpu_load'} ne 'high') 
     237    { 
     238      $doc_obj->add_utf8_metadata($doc_obj->get_top_section(), sprintf("Encrypted%05d", $counter), $encrypted_text); 
     239    } 
    237240    # - shorten text by chunk length bytes, and repeat until text is exhausted 
    238241    $text = substr($text, $multiplier * $key_length); 
     
    282285    push(@lexicon, $word . ':' . $raw_lexicon->{$word}); 
    283286  } 
    284   $doc_obj->add_metadata($doc_obj->get_top_section(), "Lexicon", join(', ', @lexicon)); 
     287  if ($self->{'cpu_load'} ne 'high') 
     288  { 
     289    $doc_obj->add_metadata($doc_obj->get_top_section(), "Lexicon", join(', ', @lexicon)); 
     290  } 
    285291  $self->_debugPrint('Generated lexicon'); 
    286292} 
     
    335341    push(@word_lengths, $word_length . ':' . $raw_word_lengths->{$word_length}); 
    336342  } 
    337   $doc_obj->add_metadata($doc_obj->get_top_section(), "WordLengths", join(', ', @word_lengths)); 
     343  if ($self->{'cpu_load'} ne 'high') 
     344  { 
     345    $doc_obj->add_metadata($doc_obj->get_top_section(), "WordLengths", join(', ', @word_lengths)); 
     346  } 
    338347  $self->_debugPrint('Generated word length information'); 
    339348}