Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit b182be4d authored by Arnaud Bey's avatar Arnaud Bey
Browse files

remove useless stopwatch

parent 634944a2
......@@ -58,7 +58,6 @@ class ImportManager
// Gestion du lexique
$pathFileLexicon = $pathLexiconDir.DIRECTORY_SEPARATOR."lexicon.tsv";
//$linesLexicon = file($pathFileLexicon);
$this->parseTSVlexicon($pathFileLexicon, $specs);
return;
......@@ -145,14 +144,7 @@ class ImportManager
$total = count(file($pathFileLexicon));
$stopwatch = new Stopwatch();
$bigrams=[];
$stopwatchName = uniqid();
/*
$rootTime = "root-".uniqid();
$featureTime = "feature-".uniqid();
$startTime = "start-".uniqid();
*/
$stopwatch->start("global_import");
$stopwatch->start($stopwatchName);
......@@ -164,10 +156,6 @@ class ImportManager
if (preg_match_all("/^([^\t]+)\t([^\t]+)\t([^\t]+)\s*$/", $line, $matches)) {
$uid1 = uniqid();
$uid2 = uniqid();
$iterationTime = "iteration-".$uid1.$uid2;
$stopwatch->start($iterationTime);
$wordValue = $matches[1][0];
$rootValue = $matches[2][0];
......@@ -181,24 +169,19 @@ class ImportManager
$string2print.=" / EREGI = ".$cleanWordValue."\n";
// ROOT
//$stopwatch->start($rootTime);
$root = $this->rm->findOrCreate($language, $rootValue, $roots);
//$stopwatch->stop($rootTime);
// FEATURES
//$stopwatch->start($featureTime);
$labelsNValues = explode(",", $matches[3][0]);
$features = [];
foreach ($labelsNValues as $labelNValue) {
$featureStringTab = explode("=", $labelNValue);
$features[] = $this->fm->findOrCreate($language, $featureStringTab[0], $featureStringTab[1], $featuresToFlush);
}
//$stopwatch->stop($featureTime);
// WORD
$this->wm->create($language, $root, $features, $wordValue, $cleanWordValue);
//$stopwatch->start($startTime);
// Gestion des lettres et débuts de mots
$wordsLetters = preg_split('//u', $cleanWordValue, null, PREG_SPLIT_NO_EMPTY);
$wordStartString = "";
......@@ -218,21 +201,17 @@ class ImportManager
}
$previousLetter = $wordLetter;
}
//$stopwatch->stop($startTime);
if ($flushCpt == $maxToFlush) {
$flushTime = "start-".$uid1.$uid2;
$stopwatch->start($flushTime);
$this->wm->createStarts($language, $wordStarts);
unset($wordStarts);
$wordStarts = null;
$wordStarts = [];
$this->flushAndFreeMemory();
$flushCpt = 1;
unset($roots);
$roots = null;
$roots = [];
unset($featuresToFlush);
$featuresToFlush = null;
$featuresToFlush = [];
$languageId = $specs["language_id"];
......@@ -244,25 +223,6 @@ class ImportManager
echo "max memory > " . $event->getMemory()/1048576 . " MB \n";
echo "duration > " . $event->getDuration()/1000 . " seconds \n\n";
/*
$event = $stopwatch->stop($flushTime);
echo "FLUSH duration > " . $event->getDuration()/1000 . " seconds \n";
$event = $stopwatch->start($rootTime);
$event = $stopwatch->stop($rootTime);
echo "ROOT duration > " . $event->getDuration()/1000 . " seconds \n";
$event = $stopwatch->start($featureTime);
$event = $stopwatch->stop($featureTime);
echo "FEATURE duration > " . $event->getDuration()/1000 . " seconds \n";
$event = $stopwatch->start($startTime);
$event = $stopwatch->stop($startTime);
echo "START duration > " . $event->getDuration()/1000 . " seconds \n\n";
$rootTime = "root-".uniqid();
$featureTime = "feature-".uniqid();
$startTime = "start-".uniqid();
*/
$stopwatchName = uniqid();
$stopwatch->start($stopwatchName);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment