RFR: 8266951: Partial in-lining for vectorized mismatch operation using AVX512 masked instructions

Jatin Bhateja jbhateja at openjdk.java.net
Fri May 14 18:02:37 UTC 2021


On Fri, 14 May 2021 11:26:29 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Thanks for the explanations on why partial inlining can be beneficial. Ideally it would be great if the only changes we made to the Java code were to the threshold values.
>> 
>> For example:
>> 
>>     public static int mismatch(byte[] a,
>>                                byte[] b,
>>                                int length) {
>>         // ISSUE: defer to index receiving methods if performance is good
>>         // assert length <= a.length
>>         // assert length <= b.length
>> 
>>         int i = 0;
>>         if (length > BYTE_THRESHOLD) {
>>             if (a[0] != b[0])
>>                 return 0;
>>             i = vectorizedMismatch(
>>                     a, Unsafe.ARRAY_BYTE_BASE_OFFSET,
>>                     b, Unsafe.ARRAY_BYTE_BASE_OFFSET,
>>                     length, LOG2_ARRAY_BYTE_INDEX_SCALE);
>>             if (i >= 0)
>>                 return i;
>>             // Align to tail
>>             i = length - ~i;
>> //            assert i >= 0 && i <= 7;
>>         }
>>         // Tail < 8 bytes
>>         for (; i < length; i++) {
>>             if (a[i] != b[i])
>>                 return i;
>>         }
>>         return -1;
>>     }
>> 
>> 
>> Where `BYTE_THRESHOLD` is initialized to 7 or 0, based on querying some HotSpot runtime property. When `BYTE_THRESHOLD == 0` i hope the `length > BYTE_THRESHOLD` check is strength reduced in many cases.
>> 
>> That does leave the `i >= 0` check of the result from  `vectorizedMismatch`, perhaps that also has some minor impact? However, maybe since you are doing partial inlining and you know that your `vectorizedMismatch` intrinsic never returns a -ve value you could elide that check? 
>> 
>> A quick experiment would be to apply your HotSpot changes and use the existing Java code, replacing the constant threshold values with 0. The we can carefully look at the code gen and perf results.
>
> Hi @PaulSandoz , I have reinstated the tail handling in java to avoid any impact on other targets. Update performance numbers still show gains for small comparison sized upto -XX:UsePartialInlineSize. Thus patch now does not changes existing java implementation of VectorizedMismatch.

> @jatin-bhateja that's good. Did performance numbers change after reverting the Java changes?
> 
Yes, there is around 5% variation. 

Benchmark | Array Length | Baseline (ops/ms) | PI32 (ops/ms) | Gain | PI64 (ops/ms) | Gain
-- | -- | -- | -- | -- | -- | --
ArraysMismatch.Byte.differentSubrangeMatches | 16 | 128575.325 | 144855.224 | 1.126617599 | 135549.783 | 1.054244141
ArraysMismatch.Byte.differentSubrangeMatches | 32 | 125000.325 | 140417.725 | 1.123338879 | 134738.852 | 1.077908013
ArraysMismatch.Byte.differentSubrangeMatches | 64 | 122121.658 | 141980.289 | 1.162613506 | 135276.983 | 1.107723112
ArraysMismatch.Byte.differentSubrangeMatches | 90 | 89949.502 | 82139.615 | 0.913174761 | 124708.875 | 1.386432078
ArraysMismatch.Byte.differentSubrangeMatches | 800 | 59648.979 | 64744.783 | 1.085429861 | 66158.56 | 1.109131474
ArraysMismatch.Byte.matches | 16 | 162496.975 | 178905.62 | 1.100978157 | 168902.064 | 1.039416666
ArraysMismatch.Byte.matches | 32 | 149555.964 | 178809.802 | 1.195604623 | 168173.504 | 1.12448544
ArraysMismatch.Byte.matches | 64 | 138302.297 | 120508.305 | 0.871339866 | 168874.573 | 1.221054
ArraysMismatch.Byte.matches | 90 | 102398.54 | 97189.139 | 0.949126218 | 99180.606 | 0.968574415
ArraysMismatch.Byte.matches | 800 | 50774.834 | 46342.805 | 0.912712093 | 46519.1 | 0.916184187
ArraysMismatch.Byte.mismatchEnd | 16 | 150496.869 | 193526.12 | 1.285914593 | 183319.104 | 1.218092477
ArraysMismatch.Byte.mismatchEnd | 32 | 151782.112 | 193680.387 | 1.276042245 | 183753.905 | 1.210642694
ArraysMismatch.Byte.mismatchEnd | 64 | 140578.852 | 122157.726 | 0.868962324 | 183616.047 | 1.30614274
ArraysMismatch.Byte.mismatchEnd | 90 | 117184.096 | 104009.41 | 0.887572747 | 104198.932 | 0.889190048
ArraysMismatch.Byte.mismatchEnd | 800 | 47585.021 | 47742.853 | 1.003316842 | 47694.384 | 1.002298265
ArraysMismatch.Byte.mismatchMid | 16 | 162373.338 | 198711.462 | 1.223793662 | 183324.738 | 1.129032268
ArraysMismatch.Byte.mismatchMid | 32 | 151647.714 | 193679.657 | 1.277168326 | 183030.74 | 1.206946911
ArraysMismatch.Byte.mismatchMid | 64 | 141058.854 | 121500.09 | 0.861343238 | 183278.428 | 1.299304672
ArraysMismatch.Byte.mismatchMid | 90 | 140839.572 | 122118.754 | 0.867077003 | 121896.873 | 0.865501586
ArraysMismatch.Byte.mismatchMid | 800 | 65953.822 | 65120.08 | 0.987358701 | 70891.518 | 1.074865957
ArraysMismatch.Byte.mismatchStart | 16 | 162334.573 | 193670.485 | 1.193032891 | 183351.662 | 1.129467732
ArraysMismatch.Byte.mismatchStart | 32 | 151668.759 | 198425.832 | 1.30828414 | 181890.834 | 1.19926368
ArraysMismatch.Byte.mismatchStart | 64 | 151644.763 | 128241.079 | 0.845667707 | 183270.344 | 1.208550433
ArraysMismatch.Byte.mismatchStart | 90 | 151565.239 | 128628.061 | 0.848664653 | 129050.748 | 0.851453466
ArraysMismatch.Byte.mismatchStart | 800 | 149279.868 | 129676.597 | 0.86868108 | 129644.754 | 0.86846777
ArraysMismatch.Char.differentSubrangeMatches | 16 | 125066.795 | 134560.133 | 1.075906143 | 128522.659 | 1.027632146
ArraysMismatch.Char.differentSubrangeMatches | 32 | 118622.375 | 135174.281 | 1.139534434 | 129247.294 | 1.089569265
ArraysMismatch.Char.differentSubrangeMatches | 64 | 110989.736 | 101324.562 | 0.912918308 | 127740.841 | 1.150924812
ArraysMismatch.Char.differentSubrangeMatches | 90 | 88158.505 | 86103.35 | 0.976687955 | 84913.129 | 0.963187035
ArraysMismatch.Char.differentSubrangeMatches | 800 | 44786.047 | 44888.007 | 1.002276602 | 45266.381 | 1.010725081
ArraysMismatch.Char.matches | 16 | 150449.365 | 180300.26 | 1.198411572 | 167831.799 | 1.115536772
ArraysMismatch.Char.matches | 32 | 137508.243 | 121613.2 | 0.884406617 | 168529.38 | 1.225594745
ArraysMismatch.Char.matches | 64 | 111238.281 | 104451.169 | 0.938985824 | 104456.106 | 0.939030207
ArraysMismatch.Char.matches | 90 | 89576.98 | 82706.461 | 0.923300395 | 82094.852 | 0.916472647
ArraysMismatch.Char.matches | 800 | 25890.552 | 25076.19 | 0.968545978 | 25175.427 | 0.97237892
ArraysMismatch.Char.mismatchEnd | 16 | 148744.669 | 193735.827 | 1.302472407 | 182679.165 | 1.228139242
ArraysMismatch.Char.mismatchEnd | 32 | 139790.505 | 120976.307 | 0.865411474 | 182651.879 | 1.306611483
ArraysMismatch.Char.mismatchEnd | 64 | 115203.826 | 105308.171 | 0.91410307 | 104283.277 | 0.905206716
ArraysMismatch.Char.mismatchEnd | 90 | 85344.044 | 88961.211 | 1.042383356 | 88986.943 | 1.042684865
ArraysMismatch.Char.mismatchEnd | 800 | 21198.514 | 22762.467 | 1.073776539 | 20532.903 | 0.968601054
ArraysMismatch.Char.mismatchMid | 16 | 148694.307 | 193547.037 | 1.301643895 | 182739.927 | 1.228963843
ArraysMismatch.Char.mismatchMid | 32 | 131819.638 | 120542.455 | 0.914449902 | 182522.226 | 1.384636074
ArraysMismatch.Char.mismatchMid | 64 | 122303.688 | 112374.874 | 0.91881836 | 112962.46 | 0.923622679
ArraysMismatch.Char.mismatchMid | 90 | 119193.595 | 110435.962 | 0.926525977 | 112841.238 | 0.946705551
ArraysMismatch.Char.mismatchMid | 800 | 50811.151 | 48327.149 | 0.951113054 | 43349.205 | 0.853143535
ArraysMismatch.Char.mismatchStart | 16 | 148954.747 | 196332.899 | 1.318070776 | 182895.579 | 1.227860022
ArraysMismatch.Char.mismatchStart | 32 | 140350.687 | 128903.712 | 0.918440193 | 182417.843 | 1.299728893
ArraysMismatch.Char.mismatchStart | 64 | 148661.774 | 128942.646 | 0.86735576 | 128923.292 | 0.867225572
ArraysMismatch.Char.mismatchStart | 90 | 149813.17 | 128907.497 | 0.860455039 | 128962.22 | 0.860820314
ArraysMismatch.Char.mismatchStart | 800 | 152547.918 | 128763.275 | 0.844084119 | 128908.197 | 0.845034129
ArraysMismatch.Double.differentSubrangeMatches | 16 | 108995.329 | 116181.518 | 1.065931165 | 115518.042 | 1.059843968
ArraysMismatch.Double.differentSubrangeMatches | 32 | 92067.783 | 97014.234 | 1.053726188 | 96970.016 | 1.053245911
ArraysMismatch.Double.differentSubrangeMatches | 64 | 78196.352 | 78152.45 | 0.999438567 | 78147.974 | 0.999381327
ArraysMismatch.Double.differentSubrangeMatches | 90 | 61344.251 | 68694.658 | 1.119822263 | 68766.112 | 1.120987067
ArraysMismatch.Double.differentSubrangeMatches | 800 | 14944.82 | 15219.863 | 1.018403902 | 15218.313 | 1.018300187
ArraysMismatch.Double.matches | 16 | 119314.736 | 120298.817 | 1.008247774 | 120356.273 | 1.008729324
ArraysMismatch.Double.matches | 32 | 84908.095 | 88858.203 | 1.04652216 | 88826.453 | 1.046148227
ArraysMismatch.Double.matches | 64 | 52849.331 | 63069.589 | 1.193384813 | 63076.972 | 1.193524512
ArraysMismatch.Double.matches | 90 | 50500.323 | 50214.691 | 0.994343957 | 50508.649 | 1.00016487
ArraysMismatch.Double.matches | 800 | 8825.189 | 8843.06 | 1.002024999 | 8848.091 | 1.002595072
ArraysMismatch.Double.mismatchEnd | 16 | 116518.598 | 119160.345 | 1.022672321 | 119417.269 | 1.024877325
ArraysMismatch.Double.mismatchEnd | 32 | 86686.542 | 86737.967 | 1.000593229 | 86245.95 | 0.994917412
ArraysMismatch.Double.mismatchEnd | 64 | 62844.082 | 62865.51 | 1.000340971 | 62824.22 | 0.999683948
ArraysMismatch.Double.mismatchEnd | 90 | 46811.941 | 47682.209 | 1.018590727 | 47683.524 | 1.018618818
ArraysMismatch.Double.mismatchEnd | 800 | 8123.098 | 8154.869 | 1.003911193 | 8122.968 | 0.999983996
ArraysMismatch.Double.mismatchMid | 16 | 113774.491 | 112407.289 | 0.987983229 | 113347.865 | 0.996250249
ArraysMismatch.Double.mismatchMid | 32 | 93878.771 | 93191.093 | 0.99267483 | 93148.916 | 0.992225559
ArraysMismatch.Double.mismatchMid | 64 | 73891.531 | 75278.408 | 1.018769093 | 76375.521 | 1.033616708
ArraysMismatch.Double.mismatchMid | 90 | 71601.957 | 71609.917 | 1.00011117 | 71185.73 | 0.994186933
ArraysMismatch.Double.mismatchMid | 800 | 12585.323 | 12687.35 | 1.008106824 | 12684.958 | 1.007916761
ArraysMismatch.Double.mismatchStart | 16 | 141340.973 | 139820.577 | 0.989243063 | 141687.838 | 1.002454101
ArraysMismatch.Double.mismatchStart | 32 | 141778.446 | 139839.172 | 0.9863218 | 141793.558 | 1.000106589
ArraysMismatch.Double.mismatchStart | 64 | 141447.19 | 139777.342 | 0.988194548 | 141735.624 | 1.002039164
ArraysMismatch.Double.mismatchStart | 90 | 141672.66 | 139952.848 | 0.987860664 | 141435.432 | 0.99832552
ArraysMismatch.Double.mismatchStart | 800 | 129247.638 | 139490.678 | 1.079251274 | 144563.768 | 1.118502204
ArraysMismatch.Float.differentSubrangeMatches | 16 | 110910.016 | 120022.108 | 1.082157521 | 119996.294 | 1.081924774
ArraysMismatch.Float.differentSubrangeMatches | 32 | 111486.226 | 111770.346 | 1.002548476 | 110773.578 | 0.993607748
ArraysMismatch.Float.differentSubrangeMatches | 64 | 85109.196 | 93874.459 | 1.102988436 | 93800.272 | 1.102116768
ArraysMismatch.Float.differentSubrangeMatches | 90 | 76165.301 | 76150.992 | 0.999812132 | 76218.427 | 1.000697509
ArraysMismatch.Float.differentSubrangeMatches | 800 | 24344.012 | 24945.968 | 1.024727066 | 24975.996 | 1.025960552
ArraysMismatch.Float.matches | 16 | 133246.909 | 139879.808 | 1.049779008 | 139300.513 | 1.045431478
ArraysMismatch.Float.matches | 32 | 115453.05 | 116866.329 | 1.012241158 | 116930.525 | 1.012797193
ArraysMismatch.Float.matches | 64 | 86868.384 | 87499.944 | 1.007270309 | 87378.551 | 1.005872873
ArraysMismatch.Float.matches | 90 | 69382.063 | 69320.95 | 0.999119182 | 69270.638 | 0.998394037
ArraysMismatch.Float.matches | 800 | 15797.436 | 15305.406 | 0.968853806 | 15368.778 | 0.972865343
ArraysMismatch.Float.mismatchEnd | 16 | 128972.145 | 127558.472 | 0.989038928 | 126943.523 | 0.984270852
ArraysMismatch.Float.mismatchEnd | 32 | 99500.703 | 106165.752 | 1.066984944 | 104714.992 | 1.052404544
ArraysMismatch.Float.mismatchEnd | 64 | 85579.522 | 84530.586 | 0.987743143 | 84477.75 | 0.987125752
ArraysMismatch.Float.mismatchEnd | 90 | 71330.733 | 76663.363 | 1.074759221 | 71542.67 | 1.002971188
ArraysMismatch.Float.mismatchEnd | 800 | 12684.13 | 12712.423 | 1.002230583 | 14291.866 | 1.126751776
ArraysMismatch.Float.mismatchMid | 16 | 119900.83 | 124084.55 | 1.03489317 | 124324.212 | 1.036892005
ArraysMismatch.Float.mismatchMid | 32 | 112489.957 | 111460.099 | 0.990844889 | 112307.057 | 0.998374077
ArraysMismatch.Float.mismatchMid | 64 | 93700.093 | 93598.863 | 0.998919638 | 93964.963 | 1.002826785
ArraysMismatch.Float.mismatchMid | 90 | 89995.813 | 92882.423 | 1.032074937 | 90128.506 | 1.001474435
ArraysMismatch.Float.mismatchMid | 800 | 20683.982 | 20964.562 | 1.013565086 | 20912.721 | 1.011058751
ArraysMismatch.Float.mismatchStart | 16 | 140865.868 | 140832.899 | 0.999765955 | 140179.035 | 0.995124206
ArraysMismatch.Float.mismatchStart | 32 | 140963.807 | 141210.069 | 1.001746987 | 141155.621 | 1.001360732
ArraysMismatch.Float.mismatchStart | 64 | 128036.089 | 140209.323 | 1.095076584 | 141165.264 | 1.102542768
ArraysMismatch.Float.mismatchStart | 90 | 139812.729 | 143867.129 | 1.02899879 | 109229.788 | 0.781257821
ArraysMismatch.Float.mismatchStart | 800 | 143800.67 | 139801.737 | 0.972191138 | 143862.688 | 1.000431278
ArraysMismatch.Int.differentSubrangeMatches | 16 | 119963.836 | 119300.373 | 0.994469475 | 119968.86 | 1.000041879
ArraysMismatch.Int.differentSubrangeMatches | 32 | 110957.277 | 110224.844 | 0.993398964 | 111157.285 | 1.001802568
ArraysMismatch.Int.differentSubrangeMatches | 64 | 85378.666 | 93789.643 | 1.098513802 | 93743.202 | 1.097969861
ArraysMismatch.Int.differentSubrangeMatches | 90 | 76146.387 | 76201.059 | 1.000717985 | 76057.16 | 0.998828218
ArraysMismatch.Int.differentSubrangeMatches | 800 | 24761.361 | 24891.597 | 1.005259646 | 24716.676 | 0.998195374
ArraysMismatch.Int.matches | 16 | 137433.609 | 139858.37 | 1.017643144 | 138042.695 | 1.004431856
ArraysMismatch.Int.matches | 32 | 113947.437 | 117383.592 | 1.030155615 | 114140.779 | 1.001696765
ArraysMismatch.Int.matches | 64 | 83458.037 | 87402.272 | 1.047260098 | 87558.197 | 1.049128402
ArraysMismatch.Int.matches | 90 | 69359.801 | 69129.876 | 0.99668504 | 69202.217 | 0.997728021
ArraysMismatch.Int.matches | 800 | 15151.507 | 15245.003 | 1.006170739 | 15778.822 | 1.041402812
ArraysMismatch.Int.mismatchEnd | 16 | 137635.65 | 136617.544 | 0.99260289 | 136584.159 | 0.99236033
ArraysMismatch.Int.mismatchEnd | 32 | 114877.262 | 115193.044 | 1.002748864 | 115280.958 | 1.003514151
ArraysMismatch.Int.mismatchEnd | 64 | 86416.926 | 85360.499 | 0.987775231 | 85492.741 | 0.989305509
ArraysMismatch.Int.mismatchEnd | 90 | 73080.648 | 79063.102 | 1.081860987 | 73012.794 | 0.999071519
ArraysMismatch.Int.mismatchEnd | 800 | 14493.463 | 12788.852 | 0.882387598 | 14485.628 | 0.999459411
ArraysMismatch.Int.mismatchMid | 16 | 131819.961 | 135110.592 | 1.024963071 | 133456.021 | 1.012411322
ArraysMismatch.Int.mismatchMid | 32 | 121601.267 | 121323.539 | 0.997716076 | 121033.479 | 0.995330739
ArraysMismatch.Int.mismatchMid | 64 | 96305.313 | 98513.588 | 1.022929939 | 99524.464 | 1.033426515
ArraysMismatch.Int.mismatchMid | 90 | 93047.732 | 95701.604 | 1.028521619 | 95748.806 | 1.029028907
ArraysMismatch.Int.mismatchMid | 800 | 24763.584 | 24529.368 | 0.990541918 | 24566.322 | 0.99203419
ArraysMismatch.Int.mismatchStart | 16 | 140288.976 | 149381.016 | 1.064809369 | 148432.735 | 1.058049886
ArraysMismatch.Int.mismatchStart | 32 | 140299.038 | 149933.984 | 1.068674355 | 148666.253 | 1.059638435
ArraysMismatch.Int.mismatchStart | 64 | 140390.509 | 148516.304 | 1.057879945 | 149125.82 | 1.062221521
ArraysMismatch.Int.mismatchStart | 90 | 135683.215 | 149479.127 | 1.101677367 | 152544.074 | 1.124266358
ArraysMismatch.Int.mismatchStart | 800 | 152579.586 | 152534.551 | 0.999704843 | 149863.75 | 0.982200528
ArraysMismatch.Long.differentSubrangeMatches | 16 | 125375.624 | 123127.977 | 0.982072695 | 125570.502 | 1.001554353
ArraysMismatch.Long.differentSubrangeMatches | 32 | 100353.427 | 104527.284 | 1.041591574 | 100339.027 | 0.999856507
ArraysMismatch.Long.differentSubrangeMatches | 64 | 79732.381 | 80799.459 | 1.013383245 | 79755.01 | 1.000283812
ArraysMismatch.Long.differentSubrangeMatches | 90 | 70378.676 | 71253.509 | 1.01243037 | 70502.564 | 1.001760306
ArraysMismatch.Long.differentSubrangeMatches | 800 | 15229.105 | 15139.187 | 0.994095648 | 15172.463 | 0.996280674
ArraysMismatch.Long.matches | 16 | 119081.321 | 119487.306 | 1.003409309 | 119758.812 | 1.005689314
ArraysMismatch.Long.matches | 32 | 88599.37 | 88638.351 | 1.000439969 | 88576.011 | 0.999736353
ArraysMismatch.Long.matches | 64 | 58898.468 | 53095.514 | 0.901475298 | 62427.169 | 1.059911592
ArraysMismatch.Long.matches | 90 | 50386.116 | 50338.305 | 0.999051108 | 50562.903 | 1.003508645
ArraysMismatch.Long.matches | 800 | 8820.281 | 8529.311 | 0.967011255 | 8852.332 | 1.003633784
ArraysMismatch.Long.mismatchEnd | 16 | 125007.971 | 128210.129 | 1.025615631 | 127881.579 | 1.022987398
ArraysMismatch.Long.mismatchEnd | 32 | 83076.909 | 88860.258 | 1.069614398 | 90371.34 | 1.087803351
ArraysMismatch.Long.mismatchEnd | 64 | 64514.133 | 64481.669 | 0.999496792 | 64403.391 | 0.998283446
ArraysMismatch.Long.mismatchEnd | 90 | 46519.966 | 47637.256 | 1.024017429 | 47623.133 | 1.023713839
ArraysMismatch.Long.mismatchEnd | 800 | 8141.139 | 7196.482 | 0.883965008 | 7205.709 | 0.885098387
ArraysMismatch.Long.mismatchMid | 16 | 122535.55 | 122468.245 | 0.999450731 | 121420.652 | 0.990901432
ArraysMismatch.Long.mismatchMid | 32 | 97246.708 | 99410.056 | 1.022245977 | 99415.553 | 1.022302503
ArraysMismatch.Long.mismatchMid | 64 | 78567.11 | 76615.257 | 0.975156869 | 76589.915 | 0.974834317
ArraysMismatch.Long.mismatchMid | 90 | 72329.55 | 74842.274 | 1.034739937 | 73309.119 | 1.013543137
ArraysMismatch.Long.mismatchMid | 800 | 15203.544 | 12744.161 | 0.838236203 | 15195.833 | 0.999492816
ArraysMismatch.Long.mismatchStart | 16 | 149836.786 | 149828.664 | 0.999945794 | 149875.077 | 1.000255551
ArraysMismatch.Long.mismatchStart | 32 | 149794.513 | 147781.365 | 0.986560603 | 147783.146 | 0.986572492
ArraysMismatch.Long.mismatchStart | 64 | 150066.12 | 147763.313 | 0.984654718 | 147705.026 | 0.984266309
ArraysMismatch.Long.mismatchStart | 90 | 149769.076 | 149930.834 | 1.001080049 | 147765.191 | 0.986620169
ArraysMismatch.Long.mismatchStart | 800 | 153228.897 | 153291.369 | 1.000407704 | 147317.909 | 0.961423804
ArraysMismatch.Short.differentSubrangeMatches | 16 | 124165.057 | 135373.754 | 1.090272556 | 128483.318 | 1.034778392
ArraysMismatch.Short.differentSubrangeMatches | 32 | 108467.591 | 139665.229 | 1.287621747 | 129280.478 | 1.191881158
ArraysMismatch.Short.differentSubrangeMatches | 64 | 101789.936 | 101026.787 | 0.992502707 | 128695.583 | 1.264325218
ArraysMismatch.Short.differentSubrangeMatches | 90 | 79113.558 | 86119.991 | 1.088561723 | 84812.205 | 1.072031231
ArraysMismatch.Short.differentSubrangeMatches | 800 | 44717.401 | 44941.053 | 1.005001453 | 45136.069 | 1.00936253
ArraysMismatch.Short.matches | 16 | 150437.283 | 180578.877 | 1.200359867 | 167914.258 | 1.116174492
ArraysMismatch.Short.matches | 32 | 132788.255 | 121258.183 | 0.913169489 | 168523.439 | 1.269114042
ArraysMismatch.Short.matches | 64 | 111256.816 | 104483.87 | 0.939123316 | 104146.178 | 0.936088069
ArraysMismatch.Short.matches | 90 | 89629.331 | 82256.3 | 0.917738636 | 82254.873 | 0.917722715
ArraysMismatch.Short.matches | 800 | 25875.154 | 25149.698 | 0.97196322 | 25567.552 | 0.988112071
ArraysMismatch.Short.mismatchEnd | 16 | 148537.517 | 193718.849 | 1.304174547 | 182495.003 | 1.228612183
ArraysMismatch.Short.mismatchEnd | 32 | 139814.385 | 120797.789 | 0.863986842 | 182574.092 | 1.305831957
ArraysMismatch.Short.mismatchEnd | 64 | 114830.689 | 105372.717 | 0.917635502 | 102450.982 | 0.892191651
ArraysMismatch.Short.mismatchEnd | 90 | 89778.028 | 88480.375 | 0.985545985 | 88414.905 | 0.984816742
ArraysMismatch.Short.mismatchEnd | 800 | 21231.162 | 22720.746 | 1.070160267 | 22762.858 | 1.072143767
ArraysMismatch.Short.mismatchMid | 16 | 148684.681 | 192816.173 | 1.296812635 | 182828.042 | 1.229636038
ArraysMismatch.Short.mismatchMid | 32 | 133351.494 | 121165.274 | 0.908615797 | 182578.799 | 1.369154507
ArraysMismatch.Short.mismatchMid | 64 | 122310.455 | 111705.87 | 0.913297804 | 112499.229 | 0.919784241
ArraysMismatch.Short.mismatchMid | 90 | 125078.209 | 110292.292 | 0.881786627 | 112900.776 | 0.902641451
ArraysMismatch.Short.mismatchMid | 800 | 50870.426 | 43223.723 | 0.849682741 | 43290.85 | 0.851002309
ArraysMismatch.Short.mismatchStart | 16 | 148721.59 | 192829.361 | 1.296579474 | 182664.555 | 1.22823159
ArraysMismatch.Short.mismatchStart | 32 | 148455.699 | 128768.914 | 0.867389496 | 183430.126 | 1.235588308
ArraysMismatch.Short.mismatchStart | 64 | 148574.311 | 127928.852 | 0.861042876 | 128884.409 | 0.867474385
ArraysMismatch.Short.mismatchStart | 90 | 149658.37 | 128839.609 | 0.860891436 | 128868.164 | 0.861082237
ArraysMismatch.Short.mismatchStart | 800 | 152433.566 | 127994.372 | 0.839673147 | 127981.695 | 0.839589982


> Do you think it is worth experimenting by setting the threshold to zero when partial inlining is supported? Maybe partial inlining will help for, say, mismatching on arrays with a length of 7 or less bytes e.g. we could test quickly with mismatching for `byte`.

Generally results looks fine in most cases there is some panelty though,  just curious if you can kindly elaborate how can we do a target specific check in java side. could not locate a relevant Java public or JDK internal API for the same.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3999


More information about the hotspot-compiler-dev mailing list