Skip to content

Optimize AllocateParameterAndReplacer() #378

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

Merged
merged 7 commits into from
Apr 24, 2025

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Apr 23, 2025

Avoid composing the same expression
Expression.MakeMemberAccess(Expression.Constant(queryParameter, parameterType), valueMemberInfo)
multiple times

Also:

  • Memoize ClosureTypeInfo(Type ParameterType, PropertyInfo ValueMemberInfo, FieldInfo[] Fields) for reusing
  • static CompiledQueryRunner.NoopReplacer to save allocations
  • Optimize IsClosure() - don't extract Type name while unnecessary
  • Remove redundant closureType.DeclaringType != null check (IsAssignableFrom() returns false with null arg)

@SergeiPavlov SergeiPavlov merged commit 132e13f into master-servicetitan Apr 24, 2025
5 checks passed
@SergeiPavlov SergeiPavlov deleted the AllocateParameterAndReplacer branch April 24, 2025 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants