Skip to content

Commit 80e0b1d

Browse files
safihamidbrettsam
authored andcommitted
Cold start Improvements for Functions
#4184 This change will improve cold starts by ~30% across the board for all languages. Here are the numbers: percentile_Time_taken_50 percentile_Time_taken_80 percentile_Time_taken_90 percentile_Time_taken_95 percentile_Time_taken_99 avg_Time_taken count_ Current cold start with placeholders 2032 2250 2359 2609 3422 2111.71276595745 94 Updated cold start with placeholders and optimization 1454 1579 1734 1906 2328 1483.76470588235 119 Current cold start without placeholders 9500 10469 11062 11453 12406 9789.04 50 Updated cold start without placeholders and optimization 6985 7859 8734 8922 9765 7208.12 50
1 parent 65c10dd commit 80e0b1d

File tree

1 file changed

+3
-1
lines changed
  • src/WebJobs.Script.WebHost/DependencyInjection/DryIoc

1 file changed

+3
-1
lines changed

src/WebJobs.Script.WebHost/DependencyInjection/DryIoc/Container.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,9 @@ public static FactoryDelegate CompileToFactoryDelegate(this Expr expression)
20452045
#if FEC_EXPRESSION_INFO
20462046
return lambdaExpr.ToLambdaExpression().Compile();
20472047
#else
2048-
return lambdaExpr.Compile();
2048+
// Passing preferInterpretation: true as the default value of False uses JIT compile which has a huge impact on Functions cold start time
2049+
// This optimization is needed for Functions Host only and is not part of the DryIoc codebase which it was copied from.
2050+
return lambdaExpr.Compile(preferInterpretation: true);
20492051
#endif
20502052
}
20512053

0 commit comments

Comments
 (0)