Ron Passerini created OLINGO-1625: ------------------------------------- Summary: 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 Fix For: (Java) V4 5.0.1
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)