[ 
https://issues.apache.org/jira/browse/NIFI-14255?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Handermann updated NIFI-14255:
------------------------------------
    Affects Version/s: 2.2.0
                       2.0.0

> SimpleRecordSchema.equals method is very slow
> ---------------------------------------------
>
>                 Key: NIFI-14255
>                 URL: https://issues.apache.org/jira/browse/NIFI-14255
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 2.0.0, 2.2.0
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>             Fix For: 2.3.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The equals method for SimpleRecordSchema calls {{isRecursive()}} which is 
> very slow. The method converts a List<RecordField> into a Stream, and then 
> for each element calls DataType.isRecursive() which often does the same. 
> Stream creation is very slow. This causes any {{Map<RecordSchema, ?>}} type 
> of structure to be very slow.
> We can re-implement to avoid any stream creation. In addition, once the 
> {{isRecursive()}} method finishes its calculation, its value can be stored in 
> a member variable. The value will not change unless its fields change. So we 
> can just lazily initialize the member variable and clear it if fields are 
> changed.



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

Reply via email to