views:

139

answers:

2

Ignoring payload size, what is relative difference in latency between an in-proc call (say in C++ or Java), a socket call to a process on the same machine, and a socket call to a process on another machine? This can be expressed as a minimum latency in ns/ms or in terms of relative orders of magnitude.

I'm looking for something similar to this:

http://duartes.org/gustavo/blog/post/what-your-computer-does-while-you-wait

... but extended to in-proc vs. network calls (assume fast intranet).

A: 

does pinging your local machine and pinging a remote machine give you any sense of relationship? A method call would of course be the other measurement.

Tim
+1  A: 

That is a good idea... not precise, but it gives the rough ratios:

method call -- ~100s ns synchronized method call -- ~1000s ns reflective method call -- low ~10,000s ns

machine loopback -- ~30,000-150,000 ns

local sub-network -- 1-2 ms

internet -- 30-100 ms