Replace switch by method name in SerializerFinderVisitMethodCall with lookup table with MethodInfo as a key

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • 4.0.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Fully Compatible
    • Dotnet Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      The main method of SerializerFinderVisitMethodCall uses huge switch by method name and then each DeductXXXMethodSerializers double-checks if the methodinfo belongs to list of supported method, that list sometimes could be relatively big and we iterating through all items.

      We can improve this by having static Dictionary<MethodInfo, delegate> which will contains all serializer deducers by methodInfo. Having single dictionary instead of switch and double-checking methodInfo reduce amount of code required for each method support, reduces risk of wrong copy-pasting and probably more performant.

            Assignee:
            Oleksandr Poliakov
            Reporter:
            Oleksandr Poliakov
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: