Uploaded image for project: 'ORC'
  1. ORC
  2. ORC-830

Do Not Copy String When Adding to StringHashTableDictionary

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.8.0
    • Java
    • None

    Description

      StringHashTableDictionary.java
          Text tmpText = new Text();
          for (int i = 0; i < candidateArray.size(); i++) {
            getText(tmpText, candidateArray.get(i));
            if (tmpText.equals(newKey)) {
              return candidateArray.get(i);
            }
          }
      

      When there is a collision adding a value into a StringHashTableDictionary, a temp Text object is created and then each value in the byte array is copied into the temp Text until a match is found (or worst-case scenario, a match is not found and every value is loaded).

      Instead of loading (copying) the values, just compare directly against the byte array without copying the data into a intermediate (temp) buffer.

      Attachments

        1. Capture_StringHashTableAdd_ORC830.PNG
          196 kB
          David Mollitor
        2. Capture_StringHashTableAdd_Main.PNG
          210 kB
          David Mollitor

        Issue Links

          Activity

            People

              belugabehr David Mollitor
              belugabehr David Mollitor
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: