...
ID | IEP-46 | ||||||||
Author | |||||||||
Sponsor | |||||||||
Created |
| ||||||||
Status |
|
Table of Contents |
---|
...
Request | |
---|---|
String | Service name |
byte | Flags: 0x01 Keep binary flag 0x02 "Has parameter types" flag (see "service name resolve logic") |
long | Timeout |
int | Count of nodes selected to invoke service. If this value is 0, no server nodes should be explicitly listed in the message, but all server cluster nodes should be selected. |
UUID * count | Node IDs |
String | Method name |
int[] | Argument count |
(int? + Object) * count | Argument type IDs to resolve method (optional, can be NULL, see "service name resolve logic") |
int | Argument count |
Object * count | if "has parameter types" flag is set) + Arguments |
Response | |
---|---|
Object | Result |
...
There 20 benchmarks totally were made (10 with the one-operation approach and 10 with the two-operations approach).
Results:
tps 1, op/sec, AVG | latency 1, nsec, AVG | tps 2, op/sec, AVG | latency 2, nsec, AVG | delta tps | delta latency |
---|---|---|---|---|---|
390113 | 2625103 | 393930 | 2600288 | 0,98% | -0,95% |
383307 | 2671531 | 370831 | 2762661 | -3,25% | 3,41% |
378431 | 2706381 | 382540 | 2678767 | 1,09% | -1,02% |
372316 | 2750314 | 377884 | 2711388 | 1,50% | -1,42% |
383258 | 2672952 | 380790 | 2689943 | -0,64% | 0,64% |
381941 | 2681639 | 398006 | 2573471 | 4,21% | -4,03% |
378778 | 2703999 | 379971 | 2695359 | 0,31% | -0,32% |
374484 | 2735758 | 380260 | 2694853 | 1,54% | -1,50% |
379535 | 2698315 | 375098 | 2731863 | -1,17% | 1,24% |
374196 | 2737032 | 373018 | 2746522 | -0,31% | 0,35% |
Conclusion: there is almost no difference between the one-operation approach and the two-operations approach (about 1% on average), so there is no reason to implement two-operations approach. Single-operation approach should be implemented as more convenient from the user's point of view.
...
To solve this problem we can pass additional information (parameter types) optionally instead of just method name. If parameter types are passed - method should be resolved using this information, if NULL is passed as parameter types are not passed method should be resolved using argument values (the same way as PlatformServices.ServiceProxyHolder#getMethod).
Parameter types it's an array of binary type IDsTo pass parameter types "has parameter types" flag of the request should be set. In this case, each argument is prefixed by int value - argument's binary type ID.
...