[ https://issues.apache.org/jira/browse/GEODE-8212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17136703#comment-17136703 ]
Alberto Bustamante Reyes commented on GEODE-8212: ------------------------------------------------- {quote}I have thought that when a new pdxtype id is requested, the client could calculate a hash of the class and field names, and we could have a map of hashes & PdxType ids. So if we dont know the PdxType id of a new object, we could calculate its hash, check if we have an id for that hash and in that case avoid the connection to the server, saving time. {quote} I have implemented a draft for this idea. I still have to write tests, but with this code I get much better performance, not exactly the same as before the change in the "operator<" but more acceptable. The same test I sent in the patch with the corrections you mentioned takes 190 milliseconds, without this code 575 milliseconds, and without this code and with the old operator< 140 milliseconds. > Change in PdxType class "<" operator impacts performance > -------------------------------------------------------- > > Key: GEODE-8212 > URL: https://issues.apache.org/jira/browse/GEODE-8212 > Project: Geode > Issue Type: Improvement > Components: native client > Reporter: Alberto Bustamante Reyes > Assignee: Blake Bender > Priority: Major > Attachments: performance_after_GEODE-7694.patch > > > While investigating a performance problem of the C++ native client, it has > been observed that change in the PdxType class "<" operator introduced by > GEODE-7694 impacts performance of PdxHelper::serializePdx(). > Im attaching a patch with some code and a test case I have used to benchmark > that method. With the current implementation in develop branch, creating just > 10 instances is enough to see the difference. The calls to serializePdx take > these times: > {noformat} > Elapsed Time (serializePdx): 32.1322 milliseconds > Elapsed Time (serializePdx): 3.06044 milliseconds > Elapsed Time (serializePdx): 1.58791 milliseconds > Elapsed Time (serializePdx): 1.62466 milliseconds > Elapsed Time (serializePdx): 1.53676 milliseconds > Elapsed Time (serializePdx): 1.59278 milliseconds > Elapsed Time (serializePdx): 1.82878 milliseconds > Elapsed Time (serializePdx): 1.36811 milliseconds > Elapsed Time (serializePdx): 1.6956 milliseconds > Elapsed Time (serializePdx): 1.46873 milliseconds > Elapsed Time (serializePdx): 1.53206 milliseconds > {noformat} > While these are the times using the old "<" operator: > {noformat} > Elapsed Time (serializePdx): 56.1524 milliseconds > Elapsed Time (serializePdx): 0.012327 milliseconds > Elapsed Time (serializePdx): 0.006325 milliseconds > Elapsed Time (serializePdx): 0.005419 milliseconds > Elapsed Time (serializePdx): 0.005266 milliseconds > Elapsed Time (serializePdx): 0.005662 milliseconds > Elapsed Time (serializePdx): 0.005407 milliseconds > Elapsed Time (serializePdx): 0.005286 milliseconds > Elapsed Time (serializePdx): 0.005467 milliseconds > Elapsed Time (serializePdx): 0.005276 milliseconds > Elapsed Time (serializePdx): 0.005298 milliseconds > {noformat} > And after creating 50.000 instances, these are the times for the last 10 > calls with the current "<" operator and with the old one respectively:: > {noformat} > Elapsed Time (serializePdx): 8.11767 milliseconds > Elapsed Time (serializePdx): 8.15727 milliseconds > Elapsed Time (serializePdx): 8.09303 milliseconds > Elapsed Time (serializePdx): 7.89909 milliseconds > Elapsed Time (serializePdx): 8.37956 milliseconds > Elapsed Time (serializePdx): 8.21303 milliseconds > Elapsed Time (serializePdx): 8.14189 milliseconds > Elapsed Time (serializePdx): 8.21266 milliseconds > Elapsed Time (serializePdx): 8.21683 milliseconds > Elapsed Time (serializePdx): 7.78765 milliseconds > {noformat} > {noformat} > Elapsed Time (serializePdx): 0.003014 milliseconds > Elapsed Time (serializePdx): 0.003 milliseconds > Elapsed Time (serializePdx): 0.003084 milliseconds > Elapsed Time (serializePdx): 0.003112 milliseconds > Elapsed Time (serializePdx): 0.00305 milliseconds > Elapsed Time (serializePdx): 0.003018 milliseconds > Elapsed Time (serializePdx): 0.003029 milliseconds > Elapsed Time (serializePdx): 0.003061 milliseconds > Elapsed Time (serializePdx): 0.003043 milliseconds > Elapsed Time (serializePdx): 0.003086 milliseconds > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)