Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3431

Avoid "schemes" HashMap lookups during struct reads/writes

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: Java - Compiler
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Flags:
      Patch

      Description

      Generated Java code for structs doesn't need to do a HashMap lookup on every read/write operation.

      Was surprised to see this show up in profilers under certain high throughput, write-heavy loads. Unclear if the cost was in the hashCode() implementation of the key or in the map lookup itself, but given this map never changes, for now it seems like it can be pretty safely replaced with a simple (and, in most cases, predictable) branch.

        Attachments

          Activity

            People

            • Assignee:
              thomaslee Tom Lee
              Reporter:
              thomaslee Tom Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: