Currently if we create a record it's fields are compared in their declaration
order. This might be ineffective in cases when two objects have "heavy" fields
equals to each other, but different "lightweight" fields (heavy and lightweight
in terms of comparison) e.g. primitives, enums, nullable/no
On Mon, 18 Dec 2023 13:42:35 GMT, Sergey Tsypanov wrote:
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> ligh
On Tue, 19 Dec 2023 06:07:31 GMT, Hannes Greule wrote:
> Arrays are compared by reference
Isn't `Arrays.equals()` used under the hood?
> You are sorting the array passed to the bootstrap method
Good point, fixed.
-
PR Comment: https://git.openjdk.org/jdk/pull/17143#issuecomment-1
On Tue, 19 Dec 2023 09:41:45 GMT, Sergey Tsypanov wrote:
> Isn't `Arrays.equals()` used under the hood?
The JLS and the API spec don't mention any special-casing of arrays, and the
code seems to use `Objects.equals` for all non-primitive types:
https://github.com/openjdk/jdk/blob/988601b324c97
On Tue, 19 Dec 2023 11:01:12 GMT, Hannes Greule wrote:
> Isn't Arrays.equals() used under the hood?
No, for arrays == is used
-
PR Comment: https://git.openjdk.org/jdk/pull/17143#issuecomment-1863374656
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> lightweight in terms of comparison) e.g. primitives, enums,
>
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> lightweight in terms of comparison) e.g. primitives, enums,
>
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> lightweight in terms of comparison) e.g. primitives, enums,
>
On Wed, 20 Dec 2023 10:11:58 GMT, Sergey Tsypanov wrote:
>> Currently if we create a record it's fields are compared in their
>> declaration order. This might be ineffective in cases when two objects have
>> "heavy" fields equals to each other, but different "lightweight" fields
>> (heavy and
On Thu, 21 Dec 2023 14:47:43 GMT, ExE Boss wrote:
>> Sergey Tsypanov has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> 8322292: Tiny improvement
>
> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 227:
>
>> 225:
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> lightweight in terms of comparison) e.g. primitives, enums,
>
On Thu, 21 Dec 2023 16:58:00 GMT, Sergey Tsypanov wrote:
>> Currently if we create a record it's fields are compared in their
>> declaration order. This might be ineffective in cases when two objects have
>> "heavy" fields equals to each other, but different "lightweight" fields
>> (heavy and
On Thu, 21 Dec 2023 18:30:40 GMT, Rob Spoor wrote:
>> Sergey Tsypanov has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Update src/java.base/share/classes/java/lang/runtime/ObjectMethods.java
>>
>> Co-authored-by: ExE Boss <3889017+ex
> Currently if we create a record it's fields are compared in their declaration
> order. This might be ineffective in cases when two objects have "heavy"
> fields equals to each other, but different "lightweight" fields (heavy and
> lightweight in terms of comparison) e.g. primitives, enums,
>
On Thu, 21 Dec 2023 19:43:50 GMT, ExE Boss wrote:
>> src/java.base/share/classes/java/lang/runtime/ObjectMethods.java line 224:
>>
>>> 222: var rt2 = mh2.type().returnType();
>>> 223: return Integer.compare(
>>> 224: rt1.isPrimitive() || rt1.isEnum() || rt
On Fri, 22 Dec 2023 13:00:11 GMT, Sergey Tsypanov wrote:
>> Currently if we create a record it's fields are compared in their
>> declaration order. This might be ineffective in cases when two objects have
>> "heavy" fields equals to each other, but different "lightweight" fields
>> (heavy and
16 matches
Mail list logo