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

Scott Carey commented on AVRO-261:
----------------------------------

bq. Thiru: does wrapping these not affect performance? Many operations iterate 
over fields or lookup enum symbols. The immutable wrapper adds another method 
call to each such operation. 

Generally, if the wrapper is very simple then the JIT is good at in-lining 
these making the wrapper 'free'.  So if its just wrapping the List api, 
delegating read methods and blocking write methods it usually will be fine 
other than the extra object allocation for the wrapper, which is less 
important.  
Inlining can get tripped up in a few cases -- Interfaces are much harder to 
inline, and polymorphic methods with more than two variations detected at 
runtime are not inlined, so don't get fancy.

Either way, this should be easy to test.


> Allow Schemas to be immutable
> -----------------------------
>
>                 Key: AVRO-261
>                 URL: https://issues.apache.org/jira/browse/AVRO-261
>             Project: Avro
>          Issue Type: New Feature
>          Components: java
>            Reporter: Kevin Oliver
>            Assignee: Thiruvalluvan M. G.
>            Priority: Minor
>         Attachments: AVRO-261.patch
>
>
> It would be nice if there was the ability to have an immutable Schema in 
> java. 
> Without this, it makes sharing schemas risky. Also, with this, we could 
> (lazily) cache the hashCode which is a fairly expensive operation today, 
> especially on something like a record.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to