Traversing an array of value types seen as an array of Object is slow
forax at univ-mlv.fr
forax at univ-mlv.fr
Fri Oct 5 19:10:46 UTC 2018
----- Mail original -----
> De: "Roland Westrelin" <rwestrel at redhat.com>
> À: "Remi Forax" <forax at univ-mlv.fr>, "valhalla-dev" <valhalla-dev at openjdk.java.net>
> Envoyé: Vendredi 5 Octobre 2018 15:45:52
> Objet: Re: Traversing an array of value types seen as an array of Object is slow
> Hi Remi,
>
>> I maybe wrong with the conclusion but this benchmark [1] show that there is
>> something fishy.
>>
>> Benchmark Mode Cnt Score Error
>> Units
>> ReifiedListBenchMark.arraylist_integer_get avgt 9 0.068 ± 0.001
>> ms/op
>> ReifiedListBenchMark.arraylist_integer_iterator avgt 9 0.069 ± 0.001
>> ms/op
>> ReifiedListBenchMark.reifiedlist_intbox_cursor avgt 9 516.526 ± 11.903
>> ms/op
>> ReifiedListBenchMark.reifiedlist_intbox_get avgt 9 523.149 ± 9.194
>> ms/op
>> ReifiedListBenchMark.reifiedlist_intbox_iterator avgt 9 514.091 ± 18.357
>> ms/op
>
> I just pushed a change that improves this (by creating a new buffer for
> a value loaded from a flattened array of unknown values and doing a bulk
> copy). Here is what I get with your benchmark:
>
> ReifiedListBenchMark.arraylist_integer_get avgt 9 0.246 ± 0.008
> ms/op
> ReifiedListBenchMark.arraylist_integer_iterator avgt 9 0.248 ± 0.022
> ms/op
> ReifiedListBenchMark.reifiedlist_intbox_cursor avgt 9 1.179 ± 0.015
> ms/op
> ReifiedListBenchMark.reifiedlist_intbox_get avgt 9 0.715 ± 0.004
> ms/op
> ReifiedListBenchMark.reifiedlist_intbox_iterator avgt 9 0.643 ± 0.013
> ms/op
>
> We're likely to improve that some more with future work.
>
> Roland.
Thanks Roland,
it's already a 500x improvement :)
I suposse that the code does not jump back into the interpreter anymore.
I will test that this week-end and try to compare the perf with installing my own inlining cache.
regards,
Rémi
More information about the valhalla-dev
mailing list