Skip to content

Commit f4bd9e9

Browse files
Copilotdadhi
andauthored
test: polish flat creation benchmark helper
Agent-Logs-Url: https://github.com/dadhi/FastExpressionCompiler/sessions/ed01d5a9-8337-4a93-a276-4c52a481fc65 Co-authored-by: dadhi <39516+dadhi@users.noreply.github.com>
1 parent 0b9fa7e commit f4bd9e9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

test/FastExpressionCompiler.Benchmarks/LightExprVsFlatExpr_Create_ComplexExpr.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ namespace FastExpressionCompiler.Benchmarks
77
[MemoryDiagnoser, RankColumn, Orderer(BenchmarkDotNet.Order.SummaryOrderPolicy.FastestToSlowest)]
88
public class LightExprVsFlatExpr_Create_ComplexExpr
99
{
10+
// Keep the created values reachable so the construction work is not elided.
1011
private FastExpressionCompiler.LightExpression.Expression<System.Func<object[], object>> _lightExpr;
1112
private ExprTree _flatExpr;
1213

test/FastExpressionCompiler.LightExpression.UnitTests/LightExpressionTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ public static Expression<Func<object[], object>> CreateComplexLightExpression_wi
236236
return expr;
237237
}
238238

239-
public static ExprTree CreateComplexFlatExpression(string p = null)
239+
public static ExprTree CreateComplexFlatExpression(string parameterName = null)
240240
{
241241
var fe = default(ExprTree);
242-
var stateParamExpr = fe.ParameterOf<object[]>(p);
242+
var stateParamExpr = fe.ParameterOf<object[]>(parameterName);
243243
var body = fe.MemberInit(
244244
fe.New(_ctorOfA,
245245
fe.New(_ctorOfB),

0 commit comments

Comments
 (0)