-
Notifications
You must be signed in to change notification settings - Fork 150
[EL] DEBUG-4879 Support multiple expression compilations #7994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Execution-Time Benchmarks Report ⏱️Execution-time results for samples comparing This PR (7994) and master. ✅ No regressions detected - check the details below Full Metrics ComparisonFakeDbCommand
HttpMessageHandler
Comparison explanationExecution-time benchmarks measure the whole time it takes to execute a program, and are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are highlighted in **red**. The following thresholds were used for comparing the execution times:
Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard. Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph). Duration chartsFakeDbCommand (.NET Framework 4.8)gantt
title Execution time (ms) FakeDbCommand (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (69ms) : 67, 70
master - mean (69ms) : 67, 70
section Bailout
This PR (7994) - mean (72ms) : 71, 73
master - mean (72ms) : 71, 73
section CallTarget+Inlining+NGEN
This PR (7994) - mean (1,012ms) : 966, 1058
master - mean (1,008ms) : 959, 1058
FakeDbCommand (.NET Core 3.1)gantt
title Execution time (ms) FakeDbCommand (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (106ms) : 103, 110
master - mean (106ms) : 103, 108
section Bailout
This PR (7994) - mean (107ms) : 106, 108
master - mean (107ms) : 106, 108
section CallTarget+Inlining+NGEN
This PR (7994) - mean (712ms) : 677, 747
master - mean (709ms) : 681, 738
FakeDbCommand (.NET 6)gantt
title Execution time (ms) FakeDbCommand (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (93ms) : 92, 95
master - mean (94ms) : 92, 95
section Bailout
This PR (7994) - mean (94ms) : 93, 95
master - mean (94ms) : 93, 95
section CallTarget+Inlining+NGEN
This PR (7994) - mean (670ms) : 643, 697
master - mean (663ms) : 644, 683
FakeDbCommand (.NET 8)gantt
title Execution time (ms) FakeDbCommand (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (93ms) : 91, 95
master - mean (92ms) : 90, 94
section Bailout
This PR (7994) - mean (93ms) : 92, 94
master - mean (93ms) : 92, 94
section CallTarget+Inlining+NGEN
This PR (7994) - mean (631ms) : 618, 645
master - mean (634ms) : 619, 648
HttpMessageHandler (.NET Framework 4.8)gantt
title Execution time (ms) HttpMessageHandler (.NET Framework 4.8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (194ms) : 190, 198
master - mean (193ms) : 189, 197
section Bailout
This PR (7994) - mean (197ms) : 194, 199
master - mean (196ms) : 194, 199
section CallTarget+Inlining+NGEN
This PR (7994) - mean (1,119ms) : 1058, 1179
master - mean (1,119ms) : 1052, 1186
HttpMessageHandler (.NET Core 3.1)gantt
title Execution time (ms) HttpMessageHandler (.NET Core 3.1)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (277ms) : 272, 282
master - mean (276ms) : 270, 282
section Bailout
This PR (7994) - mean (277ms) : 274, 280
master - mean (276ms) : 273, 280
section CallTarget+Inlining+NGEN
This PR (7994) - mean (909ms) : 864, 954
master - mean (904ms) : 856, 952
HttpMessageHandler (.NET 6)gantt
title Execution time (ms) HttpMessageHandler (.NET 6)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (270ms) : 265, 276
master - mean (270ms) : 265, 275
section Bailout
This PR (7994) - mean (270ms) : 267, 273
master - mean (269ms) : 266, 272
section CallTarget+Inlining+NGEN
This PR (7994) - mean (890ms) : 839, 941
master - mean (885ms) : 847, 923
HttpMessageHandler (.NET 8)gantt
title Execution time (ms) HttpMessageHandler (.NET 8)
dateFormat x
axisFormat %Q
todayMarker off
section Baseline
This PR (7994) - mean (269ms) : 265, 274
master - mean (268ms) : 264, 273
section Bailout
This PR (7994) - mean (270ms) : 266, 274
master - mean (269ms) : 266, 272
section CallTarget+Inlining+NGEN
This PR (7994) - mean (823ms) : 804, 842
master - mean (820ms) : 801, 839
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Summary of changes
ProbeExpressionEvaluatorto cache compiled expressions per runtime type combination (invocation target, return value, and scope members), instead of a singleLazy<>instance shared across all invocations.ExpressionCacheKeyto uniquely identify a compilation context using runtime types (Value.GetType()when available) and member runtime types to support polymorphic calls.ConcurrentDictionary<ExpressionCacheKey, …>caches for:CompiledExpression<string>[]?)CompiledExpression<bool>?)CompiledExpression<double>?)Reason for change
The previous implementation compiled expressions once (on first invocation) and reused them for all subsequent calls. This fails in polymorphic scenarios where:
object) but carry different concrete runtime types across invocations.In these cases, delegates compiled against the first observed type can fail later (typically invalid casts / expression binding mismatches), causing evaluation errors and incorrect probe results.
Implementation details
Evaluate()call:thisType:InvocationTarget.Value?.GetType()(fallback to declared type, thentypeof(object))returnType:Return.Value?.GetType()(fallback to declared type)members: runtime types captured fromScopeMember.Value?.GetType()(fallback to declaredScopeMember.Type)ConcurrentDictionary<ExpressionCacheKey, ...>TryAddExpressionCacheKeystruct:thisType,returnType, and member runtime types.ThisType,ReturnType, and the captured member type sequence (hash used as a fast-path).Test coverage
DebuggerExpressionLanguageTestsremain supported viaCompiledTemplates/CompiledConditionaccessors (now returning the first cached entry).Dependencies
Other details