<commit_before>'use strict';

var MIN_DEPTH_REQUIRED = 30;

var validator = require('./validator');
var mainLineOptimizer = require('./main-line-optimizer');
var analysisPriority = require('../../analysis/analysis-priority');
var timeoutInMilliseconds = 1000;

var optimizeSync = function (base, analyzer, baseIterator) {
    validator.validate(base);
    if(baseIterator) {
        let movesList = baseIterator.getMovesToInsufficientEvaluationDepth(base, MIN_DEPTH_REQUIRED);
        if(movesList) {
          console.log("Moves identified for deeper analysis: ", movesList.length);
          movesList.forEach(function(moves) {
            analyzer.analyzeLater(moves, base, analysisPriority.OptimizationOfNotAnalyzedEnough)
          });
          movesList = baseIterator.getMovesWithSameFenButDifferentEvaluation(base);
          movesList.forEach(function(moves) {
            analyzer.analyzeLater(moves, base, analysisPriority.OptimizationOfNotAnalyzedEnough)
          });
        }
        mainLineOptimizer.goDeeper(base, baseIterator, analyzer);
    }
};

module.exports.optimizeSync = optimizeSync;

module.exports.optimize = function (base, analyzer, baseIterator) {
    setTimeout(optimizeSync, timeoutInMilliseconds, base, analyzer, baseIterator);
};
<commit_msg>base-optimizer min depth is changed to 32<commit_after>'use strict';

var MIN_DEPTH_REQUIRED = 32;

var validator = require('./validator');
var mainLineOptimizer = require('./main-line-optimizer');
var analysisPriority = require('../../analysis/analysis-priority');
var timeoutInMilliseconds = 1000;

var optimizeSync = function (base, analyzer, baseIterator) {
    validator.validate(base);
    if(baseIterator) {
        let movesList = baseIterator.getMovesToInsufficientEvaluationDepth(base, MIN_DEPTH_REQUIRED);
        if(movesList) {
          console.log("Moves identified for deeper analysis: ", movesList.length);
          movesList.forEach(function(moves) {
            analyzer.analyzeLater(moves, base, analysisPriority.OptimizationOfNotAnalyzedEnough)
          });
          movesList = baseIterator.getMovesWithSameFenButDifferentEvaluation(base);
          movesList.forEach(function(moves) {
            analyzer.analyzeLater(moves, base, analysisPriority.OptimizationOfNotAnalyzedEnough)
          });
        }
        mainLineOptimizer.goDeeper(base, baseIterator, analyzer);
    }
};

module.exports.optimizeSync = optimizeSync;

module.exports.optimize = function (base, analyzer, baseIterator) {
    setTimeout(optimizeSync, timeoutInMilliseconds, base, analyzer, baseIterator);
};

{'fraction_non_alphanumeric': 0.10634184068058777, 'fraction_numerical': 0.005413766434648105, 'mean_word_length': 4.072549019607843, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3096633', 'n_tokens_mistral': 756, 'n_tokens_neox': 723, 'n_words': 128}