Skip to content
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

Optimize MessageCracker.IsHandlerMethod for memory #914

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions QuickFIXn/MessageCracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ private void TryBuildCallCache(MethodInfo m)

public static bool IsHandlerMethod(MethodInfo m)
{
ParameterInfo[] parameters;
return m.IsPublic
&& m.ReturnType == typeof(void)
&& m.Name.Equals("OnMessage")
&& m.GetParameters().Length == 2
&& m.GetParameters()[0].ParameterType.IsSubclassOf(typeof(Message))
&& typeof(SessionID).IsAssignableFrom(m.GetParameters()[1].ParameterType)
&& m.ReturnType == typeof(void);
&& (parameters = m.GetParameters()).Length == 2
&& parameters[0].ParameterType.IsSubclassOf(typeof(Message))
&& typeof(SessionID).IsAssignableFrom(parameters[1].ParameterType);
}


Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ What's New
* #910 - faster Message.GetMsgType that doesn't use Regex (jkulubya)
* #516 - remove ability to toggle Session-enable via HttpServer because it never really worked (gbirchmeier)
* #913/#741 - new FieldMap.ReadGroups for iterating on groups (NoviProg/gbirchmeier)
* #914 - Optimize MessageCracker.IsHandlerMethod (vasily-balansea)

### v1.12.0

Expand Down