Accumulo
  1. Accumulo
  2. ACCUMULO-1859

Conditional Mutation with 1000 conditions is slow.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: client, tserver
    • Labels:
      None

      Description

      The random walk test for conditional mutations creates a conditional mutation with 1000 conditions. I noticed this was really slow.

      I did some further testing using MiniAccumulo and was seeing times around 1300ms to 1400ms for this operation (the conditions all checked for absence and all data for the tablet was in memory).

      I traced the problem down to parsing the iterator config. Iterating over the table config, filtering non iterator props, and parsing was taking a little more than a 1ms. I modifed TableConfiguration to cache the iterator props and saw my test times drop to 120ms to 130ms.

      1. CWPTest.java
        2 kB
        Keith Turner
      2. 0002-ACCUMULO-1859-experimental.patch
        19 kB
        Keith Turner
      3. 0001-ACCUMULO-1859-experimental.patch
        8 kB
        Keith Turner

        Issue Links

          Activity

          Hide
          Keith Turner added a comment -

          Attached a file showing the experimental changes I made after locating the slow code.

          Show
          Keith Turner added a comment - Attached a file showing the experimental changes I made after locating the slow code.
          Hide
          Keith Turner added a comment -

          I ran this bug to the ground and found that DefaultConfiguration was the culprit. Its iterator() method could take up to a few milliseconds. A secondary issue was that each level of the configuration stack was resorting data (each level was taking everything from the parent and putting it into a treemap). Also, unwanted properties were being sorted. My second patch addresses all of the issues. Running the test with the second patch has the same run times as the first patch. tl;dr The first patch covered up the performance problem w/ caching, the second patch fixed it.

          Show
          Keith Turner added a comment - I ran this bug to the ground and found that DefaultConfiguration was the culprit. Its iterator() method could take up to a few milliseconds. A secondary issue was that each level of the configuration stack was resorting data (each level was taking everything from the parent and putting it into a treemap). Also, unwanted properties were being sorted. My second patch addresses all of the issues. Running the test with the second patch has the same run times as the first patch. tl;dr The first patch covered up the performance problem w/ caching, the second patch fixed it.
          Hide
          Keith Turner added a comment -

          One thing I never did determine was why DefaultConfiguration.iterator() was so slow. Looking at the code its probably either the annotation checking its doing and/or resolving the interpolated properties.

          Show
          Keith Turner added a comment - One thing I never did determine was why DefaultConfiguration.iterator() was so slow. Looking at the code its probably either the annotation checking its doing and/or resolving the interpolated properties.
          Hide
          Keith Turner added a comment -

          This is the little program I used to do performance testing.

          Show
          Keith Turner added a comment - This is the little program I used to do performance testing.
          Hide
          ASF subversion and git services added a comment -

          Commit c32fb19084688ff6c4e2c246c72b9e9783d84915 in branch refs/heads/1.6.0-SNAPSHOT from [~keith_turner]
          [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=c32fb19 ]

          ACCUMULO-1859 dramatically sped up iterating over Accumulo configs

          Show
          ASF subversion and git services added a comment - Commit c32fb19084688ff6c4e2c246c72b9e9783d84915 in branch refs/heads/1.6.0-SNAPSHOT from [~keith_turner] [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=c32fb19 ] ACCUMULO-1859 dramatically sped up iterating over Accumulo configs
          Hide
          ASF subversion and git services added a comment -

          Commit c32fb19084688ff6c4e2c246c72b9e9783d84915 in branch refs/heads/master from [~keith_turner]
          [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=c32fb19 ]

          ACCUMULO-1859 dramatically sped up iterating over Accumulo configs

          Show
          ASF subversion and git services added a comment - Commit c32fb19084688ff6c4e2c246c72b9e9783d84915 in branch refs/heads/master from [~keith_turner] [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=c32fb19 ] ACCUMULO-1859 dramatically sped up iterating over Accumulo configs

            People

            • Assignee:
              Keith Turner
              Reporter:
              Keith Turner
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development