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

Mark Payne updated NIFI-14255:
------------------------------
    Status: Patch Available  (was: Open)

> 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
>            Reporter: Mark Payne
>            Assignee: Mark Payne
>            Priority: Major
>          Time Spent: 10m
>  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