Port v7@2aa0dfb2c5 - WIP

This commit is contained in:
Stephan
2018-03-27 16:42:52 +02:00
parent c2e1ba21b2
commit 6b1ed89cb0
13 changed files with 487 additions and 168 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Linq.Expressions;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using BenchmarkDotNet.Diagnosers;
using Moq;
using Umbraco.Core.Models;
@@ -11,17 +10,9 @@ using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Tests.Benchmarks
{
[Config(typeof(Config))]
[MemoryDiagnoser]
public class ModelToSqlExpressionHelperBenchmarks
{
private class Config : ManualConfig
{
public Config()
{
Add(new MemoryDiagnoser());
}
}
public ModelToSqlExpressionHelperBenchmarks()
{
var contentMapper = new ContentMapper();
@@ -41,7 +32,7 @@ namespace Umbraco.Tests.Benchmarks
for (int i = 0; i < 100; i++)
{
var a = i;
var b = i*10;
var b = i * 10;
Expression<Func<IContent, bool>> predicate = content =>
content.Path.StartsWith("-1") && content.Published && (content.ContentTypeId == a || content.ContentTypeId == b);
@@ -68,6 +59,5 @@ namespace Umbraco.Tests.Benchmarks
var result = modelToSqlExpressionHelper.Visit(_cachedExpression);
}
}
}
}