Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-425

Performance and type safety improvment in MessageCracker.crack

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: Message Generation
    • Labels:
      None
    • Environment:
      All

      Description

      Hi,

      Low priority, but using instanceof instead of msgType.equals(XXX) pattern in MesageCracker.crack
      will give a marginal performance boost and improve type safety.

      Instead of:

      if (msgTypeValue.equals(Heartbeat.MSGTYPE))

      { onMessage((Heartbeat) message, sessionID); } else if (msgTypeValue.equals(Logon.MSGTYPE)) {

      Use:

      if (message instanceof Heartbeat) { onMessage((Heartbeat) message, sessionID); }

      else if (message instanceof Logon) {

      Also drops requirement to dig into header to get message type.

      Hope this helps,
      Bill

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bnokes Bill Nokes
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: