• Narayan Kamath's avatar
    Minor cleanup of deepHashCode / deepEquals. · 09940729
    Narayan Kamath authored
    These methods used equals() comparisons where identity
    checks would've sufficient. As expected, this results in a
    small but measurable performance increase on both art
    & dalvik.
    
    ---------------------- After --------------
    ART:
        arrayLength    benchmark      us linear runtime
                  1 DeepHashCode    8.08 =
                  1       Equals   17.68 =
                  4 DeepHashCode    8.63 =
                  4       Equals   18.20 =
                 16 DeepHashCode   19.59 =
                 16       Equals   41.19 =
                256 DeepHashCode  255.41 =
                256       Equals  483.61 ==
               2048 DeepHashCode 2321.91 ==============
               2048       Equals 4932.40 ==============================
    Dalvik:
        arrayLength    benchmark      us linear runtime
                  1 DeepHashCode    32.7 =
                  1       Equals    65.3 =
                  4 DeepHashCode    34.4 =
                  4       Equals    67.7 =
                 16 DeepHashCode    76.0 =
            ...
    09940729
DeepArrayOpsBenchmark.java 4.47 KB