Is there a reference which lists approximately how long it takes (in relative or absolute terms) to transfer information over network (udp vs tcp/ip), disk, memory (sequential/random access), in-process vs inter-process, etc.?

Eventually I'll have to measure these, but I'll appreciate pointers to ball-park figures.

Memory vs disk is not hard to find, but I' like to get my bearings for the rest of the numbers.

+3  A: 

I haven't come across anything like that yet and I think there is not really any other way than testing for your specific scenarios. There are way too many factors involved to give a consistent answer: e.g. what NIC's are you using, are they doing TCP checksum offloading, how performant is your switching fabric, what disks are you using, how much cache do they have, how much data are you transferring, a lot of small packets or a few large packets, etc., etc.

When your are talking RAM access times you're talking about 10-100ns nowadays, vs probably around 4-8ms for harddrives. Any benchmark tool should give you good results for RAM & harddrive measuring

UDP vs. TCP on the other hand, you really can't give any specific numbers. Theoretically UDP should be be 30-50% faster than TCP because it's missing the extra trip for the ACK and has a smaller header overhead, however in reality there are many cases where TCP would outperform UDP just because of congestion control. Also, TCP with Nagle turned on batches packets, which again wouldn't be a fair comparison to UDP which doesn't do that.

All in all, really do your own testing according to your needs. Even if there was a benchmark sheet somewhere around of someone who ran similar tests, they might be completely invalid and non reproducible for your application & hardware stack

Tom Frey

+1 for Tom - that's what I was going to write (just less clearly) before I saw his answer.

Another thing to consider is

  1. latency needs vs. bandwidth needs

  2. scalability of a given solution. E.g.

    • How difficult is it to upgrade the network speed (Do you need to replace NICs? wiring? routers?) vs. magnitude of possible scale (100Mb vs. 1Gb)?

    • How difficult is it to upgrade the disk speed vs. speed increase payoff?

    E.g. faster disk, disk with bigger cache assuming your use case runs towards cache-able data, RAID or other data striping, local storage vs. network storage.

In other words, your situation today may indicate that exact metrics point to disk as the best solution all things considered, but you can rarely up disk performance by 10x whereas you can plausibly do so with network if really needed.