This question queries whether to use /dev/shm or /tmp. Within the answers provided, the general impression arises that /dev/shm is faster than /tmp since it writes to RAM instead of disc. Searching the webs about this topic vaguely confirms this impression. Unfortunately, I can't find a reliable source undoubtedly showing which one is more performant, e.g. by measurement.
For example, this quote from the first answer:
Since RAM is significantly faster than disk storage, you can use /dev/shm instead of /tmp for the performance boost, if your process is I/O intensive and extensively uses temporary files.
The linked article states:
/dev/shm is nothing but implementation of traditional shared memory concept. It is an efficient means of passing data between programs. One program will create a memory portion, which other processes (if permitted) can access. This will result into speeding up things on Linux.
This does neither confirm the answer citing this web site, nor does it compare the performance of /dev/shm vs. /tmp. It is rather a mere description of what /dev/shm is.
Nonetheless, there is one comment in the first answer, stating (as of today):
There is no performance boost by using /dev/shm. /dev/shm is memory (tmpfs) backed by the disk (swap). /var/tmp is memory (disk cache) backed by the disk (on-disk filesystem). In practice, performance is about the same (tmpfs has a slight edge but not enough to matter). /tmp may be tmpfs or not depending on how the administrator configured it. There is no good reason to use /dev/shm in your scripts.
As this comment remains unchallenged, and other answers and comments suggest otherwise, the question remains whether /dev/shm is faster than /tmp or not?
NB: I'm well aware that the answer most probably is like "it depends". There is a question here on SU:SE about which filesystem to use for /tmp. There is also a related question over at SO.