[ https://issues.apache.org/jira/browse/OLINGO-1625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17862451#comment-17862451 ]
Ron Passerini commented on OLINGO-1625: --------------------------------------- I think I've followed the correct guidelines for getting a patch submitted for consideration using the Jira/Patch method describe here - [Apache Olingo Library|https://olingo.apache.org/contribute.html#contribute-via-git-patchpull-request-and-olingo-jira] If there is something I have missed, could you let me know? I assumed I would have heard something back about this by now. > The serializers have performance issues when Entities contain very large > numbers of Properties > ---------------------------------------------------------------------------------------------- > > Key: OLINGO-1625 > URL: https://issues.apache.org/jira/browse/OLINGO-1625 > Project: Olingo > Issue Type: Bug > Components: odata4-server > Affects Versions: Version (Java) V4 5.0.0 > Reporter: Ron Passerini > Priority: Major > Labels: json, performance, serialization, xml > Fix For: (Java) V4 5.0.1 > > Attachments: > 0001-OLINGO-1625-Fix-performance-problem-in-serializers-f.patch > > > I've implemented an OData service that serves up some large datasets in a > streaming fashion. Some of those datasets have large numbers of fields (over > 1,000). When I requested one of them which was around 350M in size, it took > way longer than expected. > I profiled the request in IntelliJ's profiler and found that over 75% of the > CPU cycles were spent in String.equals() comparing column names in the > serializers. This is because there is an O(N^2) issue that for every column > selected (in my case all of them) it will iterate across the entire list of > entity properties looking for the one with the same name. > I have already implemented a fix whereby before doing the property > serialization, the serializer builds a hash map of property-name-to-property, > making the resulting algorithm O(N) with the number of properties being > serialized. > After profiling the change, again in IntelliJ's profiler, the String.equals() > which was over 75% before, is now under 1%. > I will be creating a patch and attaching it momentarily. -- This message was sent by Atlassian Jira (v8.20.10#820010)