[ 
https://issues.apache.org/jira/browse/AVRO-3527?focusedWorklogId=779330&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-779330
 ]

ASF GitHub Bot logged work on AVRO-3527:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Jun/22 06:01
            Start Date: 08/Jun/22 06:01
    Worklog Time Spent: 10m 
      Work Description: steven-aerts commented on PR #1708:
URL: https://github.com/apache/avro/pull/1708#issuecomment-1149496779

   @RyanSkraba there is one small corner case, which let me doubt.
   
   When using `CharSequence` as `stringType`, the `equals` method uses a newly 
introduced `Utf8#compareSequences`.  As we could not use 
`java.lang.CharSequence#compare` which is only [available since java 
11](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/CharSequence.html#compare(java.lang.CharSequence,java.lang.CharSequence)).
   
   If we choose to introduce this change as a minor version.  It would mean 
that for the `Charsequence` `stringType`, the code generated by an 1.11.1 
compiler is incompatible with a 1.11.0 avro library.  Everything else should 
work in that constellation.
   
   Do you see that as a reason to introduce it in a major version only?




Issue Time Tracking
-------------------

    Worklog Id:     (was: 779330)
    Time Spent: 1h 20m  (was: 1h 10m)

> Generated equals() and hashCode() for SpecificRecords
> -----------------------------------------------------
>
>                 Key: AVRO-3527
>                 URL: https://issues.apache.org/jira/browse/AVRO-3527
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>            Reporter: Steven Aerts
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.12.0
>
>         Attachments: equals_hashcode_after.txt, equals_hashcode_before.txt, 
> flame_graph.jpeg
>
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> When profiling our production system, we found that it was spending almost 
> 40% of its overall time in the {{SpecificRecordBase.hashCode()}} and 
> {{SpecificRecordBase.equals()}} implementations.
> In some sections of its logic we see that almost all time is spend in those 
> function, as can be seen in attached flame graph  (blue "pyramids")
> !flame_graph.jpeg|width=385,height=99!
> By generating the {{.equals()}} and {{.hashCode()}} all this overhead 
> disappeared and this application became 35% faster overall. 
> Also on other AVRO heavy applications we saw noticeable performance gains 
> where we hadn't expect them due to this improvement.
> A generated implementation of {{.hashCode()}} becomes 5 to 10 times faster 
> than its generic counterpart. For {{.equals()}} it is 10 to 20 times faster.
> Which is also visible in the attached JMH benchmarks.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to