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

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

Commit c2e6e13194cb4f1879b8c98ff896c048caf6b8e5 in avro's branch 
refs/heads/master from Christophe Le Saec
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=c2e6e1319 ]

AVRO-3721: add method to JsonProperties


> [Java] Add cache to org.apache.avro.JsonProperties.getObjectProps
> -----------------------------------------------------------------
>
>                 Key: AVRO-3721
>                 URL: https://issues.apache.org/jira/browse/AVRO-3721
>             Project: Apache Avro
>          Issue Type: Improvement
>          Components: java
>    Affects Versions: 1.11.1
>            Reporter: Moshe Elisha
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Currently every time you invoke JsonProperties.getObjectProps on same 
> instance, the code loops over the props and creates a new LinkedHashMap and a 
> new UnmodifiableMap.
>  
> In our use case, we store a Protocol (and the JsonProperties) and access the 
> same instances multiple times.
>  
> Storing a simple cache "private Map<String, Object> objectProps;" inside 
> JsonProperties will slightly improve performance and memory usage.
> objectProps can be lazy initialized in JsonProperties.getObjectProps and 
> reset when "JsonProperties.addProp(String, JsonNode)" is invoked.
>  
> Thanks.



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

Reply via email to