Under . Net Remoting you have 3 ways of communicating by HTTP, TCP and IPC. If the commnuicatin is on the same pc I sugest using IPC channels it will speed up your calls.
Thank you! This is exactly the kind of answer I was hoping for. It turns out it was using HTTP.An operation that took 3 minutes 20 seconds with HTTP took 1 minute 24 with TCP, and 59 seconds with IPC.
59 seconds is still rather too long (from the user's perspective it is just expanding a node on a tree-view so it ought to be instant) but it is a great improvement. For the benefit of anyone else trying this, I had to specify authorizedGroup="Users" in the element on the server. Otherwise it was straightforward.
– Ian Goldby Nov 12 '10 at 14:13 I'm making this my 'accepted answer' because it is a genuine quick-win. I still need to speed the code further though. – Ian Goldby Nov 12 '10 at 14:14.
I should have been clearer in my original question: most of the time the front-end seems to be reading from the remote object, not writing to it. But I suspect that the remote object can change at any time, so caching in the front-end may not be an option. – Ian Goldby Nov 12 '10 at 10:33 @IanGoldby: If you cannot reduce the network round trips, or the cost of each round trip then you are stuck.
You will have to compromise (or use magic). – Richard Nov 12 '10 at 10:38 If the object is requested a lot you could still consider caching it, even if it's only for a few seconds. It really depends on how often the client requests the data and how critical it is.
Good luck! – Flo Nov 12 '10 at 10:47.
In short, no there are no quick wins here. Personally I would not make MyComponent (as a DTO) a MarshalByRefObject (which is presumably the problem), as those round trips are going to cripple you. I would keep it as a regular class, and just move a few key methods to pump them around (i.e.
Have a MarshalByRef manager/repository/etc class). That should reduce round-trips; if you still have problems then it will probably be bandwidth related; this is easier to fix; for example by changing the serializer. Protobuf-net allows you to do this easily by simply implementing ISerializable and forwarding the two methods (one from the interface, plus the ctor) to ProtoBuf.
Serializer - it then does all the work for you, and works with remoting. I can provide examples of this if you like. Actually, protobuf-net may help with CPU usage too, as it is a much more CPU-efficient serializer.
If you need the latest data (always see the real value), and the cost of getting the data each time dominates the runtime then you need to be radical. How about changing polling to push. Rather than calling the remote side each time you need a value, have the remote push all changes and cache the latest values locally.
Local lookups (after the initial get) are always up to date with all remoting overhead being done in the background (on another thread). Just be careful about thread safety for non-atomic types.
You can try compressing traffic. If not 100-times increase, you'll still gain some performance benefit.
The CPU is already pegged near to 100%. – Ian Goldby Nov 12 '10 at 10:28 @Ian - in this case it seems that round-trips are the most likely issue; compressing the traffic helps bandwidth, but it doesn't help latency. – Marc Gravell?
Nov 12 '10 at 11:08.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.