Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add microbenchmark for LongKeyedBucketOrds #58608

Merged
merged 13 commits into from
Jul 13, 2020

Commits on Jun 26, 2020

  1. Add microbenchmark for LongKeyedBucketOrds

    I've always been confused by the strange behavior that I saw when
    working on elastic#57304. Specifically, I saw switching from a bimorphic
    invocation to a monomorphic invocation to give us a 7%-15% performance
    bump. This felt *bonkers* to me. And, it also made me wonder whether
    it'd be worth looking into doing it everywhere.
    
    It turns out that, no, it isn't needed everywhere. This benchmark shows
    that a bimorphic invocation like:
    ```
    LongKeyedBucketOrds ords = new LongKeyedBucketOrds.ForSingle();
    ords.add(0, 0); <------ this line
    ```
    
    is 19% slower than a monomorphic invocation like:
    ```
    LongKeyedBucketOrds.ForSingle ords = new LongKeyedBucketOrds.ForSingle();
    ords.add(0, 0); <------ this line
    ```
    
    But *only* when the reference is mutable. In the example above, if
    `ords` is never changed then both perform the same. But if the `ords`
    reference is assigned twice then we start to see the difference:
    ```
    immutable bimorphic    avgt   10   6.468 ± 0.045  ns/op
    immutable monomorphic  avgt   10   6.756 ± 0.026  ns/op
    mutable   bimorphic    avgt   10   9.741 ± 0.073  ns/op
    mutable   monomorphic  avgt   10   8.190 ± 0.016  ns/op
    ```
    
    So the conclusion from all this is that we've done the right thing:
    `auto_date_histogram` is the only aggregation in which `ords` isn't final
    and it is the only aggregation that forces monomorphic invocations. All
    other aggregations use an immutable bimorphic invocation. Which is fine.
    
    Relates to elastic#56487
    nik9000 committed Jun 26, 2020
    Configuration menu
    Copy the full SHA
    7e1371e View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2020

  1. Configuration menu
    Copy the full SHA
    7c20cd4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9075f23 View commit details
    Browse the repository at this point in the history

Commits on Jul 6, 2020

  1. Configuration menu
    Copy the full SHA
    2e4fb47 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80ba140 View commit details
    Browse the repository at this point in the history

Commits on Jul 8, 2020

  1. Configuration menu
    Copy the full SHA
    6d26ed4 View commit details
    Browse the repository at this point in the history
  2. Blackhole

    nik9000 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    0f46086 View commit details
    Browse the repository at this point in the history
  3. Handle merge

    nik9000 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    dde47b2 View commit details
    Browse the repository at this point in the history
  4. javadoc

    nik9000 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    7ab3390 View commit details
    Browse the repository at this point in the history
  5. Force init

    nik9000 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    d31dd30 View commit details
    Browse the repository at this point in the history
  6. Force loading classes

    nik9000 committed Jul 8, 2020
    Configuration menu
    Copy the full SHA
    67b57db View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2020

  1. Configuration menu
    Copy the full SHA
    308c982 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f426b55 View commit details
    Browse the repository at this point in the history