Ticket #147 (closed defect: fixed)
Opened 11 years ago
Slow method invocations with reference arguments
| Reported by: | Bernhard Haumacher (haui at haumacher dot de) | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.07a |
| Component: | uka.karmi | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Passing a "new" remote reference in a remote method invocation is slow. A new remote reference is one that was just created (by passing an old one in a remote method invocation). While passing an old reference costs time(ping(ref)) - time(ping()) = 238.974 - 93.008 = 145.966 us, the cost of passing the new reference in the pingPong() method costs time(pingPong(ref)) - time(pingPong()) - time(passing-old-ref) = 1049.859 - 264.632 - 145.966 = 639.261 us.
# JP/KaRMI/RemoteResident/DistributedThreads/ParaStation/Myrinet void ping() : 93.008us void pingPong() : 264.632us void ping(ref) : 238.974us void pingPong(ref) : 1049.859us void ping2(ref) : 1020.029us synchronized(r) : 168.109us
The reason for that is the hierarchical garbage collector. It uses so called bridge objects for locally (per remote reference) counting the number of references passed to other VMs. But a bridge object can also serve as a communication proxy. Such bridge object requires more initialization that can be done lazily. When initializing bridge objects lazily, the reference passing overhead can be greatly reduced:
# JP/KaRMI/RemoteResident/DistributedThreads/ParaStation/Myrinet void ping() : 93.441 us +- 1.101us void pingPong() : 260.262 us +- 4.386us void ping(ref) : 237.287 us +- 20.265us ref ping(ref) : 358.264 us +- 55.810us void pingPong(ref) : 536.787 us +- 36.892us void ping2(ref) : 565.000 us +- 50.006us synchronized(r) : 172.106 us +- 0.168us
# JP/KaRMI/RemoteResident/DistributedThreads/TCP/Ethernet100 void ping() : 200.295us +- 1.855us void pingPong() : 416.443us +- 4.801us void ping(ref) : 328.531us +- 24.257us ref ping(ref) : 538.933us +-111.142us void pingPong(ref) : 709.770us +- 69.030us void ping2(ref) : 730.650us +- 79.527us synchronized(r) : 359.134us +- 0.326us
For comparison here is the corresponding section form the RMI benchmark:
# JP/RMI/RemoteResident/TCP/Ethernet100 void ping() : 295.238us +- 1.102us void pingPong() : 628.288us +- 11.353us void ping(ref) : 1090.861us +-138.926us ref ping(ref) : 2255.411us +-135.265us void pingPong(ref) : 2224.026us +- 58.650us void ping2(ref) : 2232.143us +- 61.107us synchronized(r) : 586.212us +- 0.719us
fixed since 1.07a.
