It's more a question of design, than speed (Shared Memory is faster), domain sockets are definitively more UNIX-style, and do a lot less problems. In terms of choice know beforehand:
Domain Sockets advantages
- blocking and non-blocking mode and switching between them
- you don't have to free them when tasks are completed
Domain sockets disadvantages
- must read and write in a linear fashion
Shared Memory advantages
- non-linear storage
- will never block
- multiple programs can access it
Shared Memory disadvantages
- need locking implementation