[ 
https://issues.apache.org/jira/browse/AVRO-3722?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17699652#comment-17699652
 ] 

ASF subversion and git services commented on AVRO-3722:
-------------------------------------------------------

Commit d797c78e570aa1efaaec72156ca80aefd88eb977 in avro's branch 
refs/heads/avro-3631/fix-fixed-serialization from Aaron Patterson
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=d797c78e5 ]

AVRO-3722: [Ruby] Eagerly initialize instance variables for better inline cache 
hits (#2132)

Eagerly initialize the `@type_adapter` instance variable to `nil` to see better 
inline cache hits

> Eagerly Initialize Instance Variables in Ruby Implementation
> ------------------------------------------------------------
>
>                 Key: AVRO-3722
>                 URL: https://issues.apache.org/jira/browse/AVRO-3722
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: ruby
>    Affects Versions: 1.11.1
>            Reporter: Aaron Patterson
>            Priority: Trivial
>              Labels: pull-request-available
>             Fix For: 1.12.0, 1.11.2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Ruby 3.2 introduced an inline cache scheme based on the "shape" of an object. 
>  The object's shape depends on what instance variables were set on the object 
> and in what order.  Lazily initializing an instance variable can cause poor 
> inline cache performance because the order in which the IV is set may not be 
> predictable.
> The Ruby version of Avro has an IV that is lazily initialized, and I would 
> like to eagerly initialize it so that we can improve cache performance.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to