[ 
https://issues.apache.org/jira/browse/GEODE-8212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134288#comment-17134288
 ] 

Alberto Bustamante Reyes commented on GEODE-8212:
-------------------------------------------------

[~bbender] / [~jbarrett] I was thinking that if the client would be able to 
calculate the pdxtype id as it is done in the server, we could improve 
performance. It would not be avoided the first time a type id is calculated for 
a given type, but next times the process will be faster.

That could be included in PdxTypeRegistry::getPDXIdForType():
# The type id is calculated
# If it is already known (that is, there is an entry in the 
pdxTypeToTypeIdMap), the id is returned (avoiding the connection with the 
server)
# If the type id is new (we dont have an entry in the pdxTypeToTypeIdMap), then 
we could ask the server to calculate the type id as it is done know (other 
option could be to keep the calculated id and communicate it to the server, but 
this will have a bigger impact)

I have not checked how the type id is calculated in the server, so I dont know 
if it would be possible to duplicate that logic to the client. What do you 
think?



> 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)

Reply via email to