Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/02/15 01:08:30 (9 years ago)
Author:
bburlacu
Message:

#1772:

  • added parameters to the SchemaCreator for calculating things in parallel
  • added parallel code to the SchemaEvaluator
  • implemented quality calculation and saving of estimated values in the scope in the UpdateEstimatedValuesOperator
  • small refactoring of QueryMatch (added some useful methods and made NodeInfo internal)
  • updated query match unit test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Tests/QueryMatchPerformanceTest.cs

    r12951 r12979  
    11using System;
     2using System.Diagnostics;
    23using System.Linq;
    34using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     
    1112    private const int MaxDepth = 12;
    1213    private const int MaxLength = 50;
    13     private const int N = 100000;
    14 
     14    private const int N = 50000;
     15    private const int Repetitions = 5;
    1516
    1617    [TestMethod]
     
    2829      };
    2930      var qm = new QueryMatch(comparer) { MatchParents = true };
    30 
     31      // warmup
    3132      int count = trees.Skip(1).Count(x => qm.Match(x, trees[0]));
    3233
     34      var sw = new Stopwatch();
     35      sw.Start();
     36      for (int i = 0; i < Repetitions; ++i)
     37        count = trees.Skip(1).Count(x => x.Length >= trees[0].Length && qm.Match(x, trees[0]));
     38      sw.Stop();
     39
    3340      Console.WriteLine("Count: " + count);
     41      Console.WriteLine("Query matches per second: " + (N - 1) / (sw.ElapsedMilliseconds / 1000.0) * Repetitions);
     42      Console.WriteLine("Total time: " + sw.ElapsedMilliseconds / 1000.0 + "s");
     43
     44      sw.Restart();
     45      for (int i = 0; i < Repetitions; ++i)
     46        count = qm.GetMatchingTrees(trees.Skip(1), trees[0]).Count();
     47      sw.Stop();
     48
     49      Console.WriteLine("Count: " + count);
     50      Console.WriteLine("Optimized query matches per second: " + (N - 1) / (sw.ElapsedMilliseconds / 1000.0) * Repetitions);
     51      Console.WriteLine("Total time: " + sw.ElapsedMilliseconds / 1000.0 + "s");
    3452    }
    3553  }
Note: See TracChangeset for help on using the changeset viewer.