detailyang / ipc_benchmark

IPC benchmark on Linux
MIT License
73 stars 54 forks source link

Shared Memory is slow. #9

Open wangxiang2713 opened 3 years ago

wangxiang2713 commented 3 years ago

Here is my result, it seems that shm is very slow, but why? TPS +------------+---------------+---------------+---------------+----------------+----------------+----------------+ | test/size | 128 x 100000 | 256 x 100000 | 512 x 100000 | 1024 x 100000 | 2048 x 100000 | 4096 x 100000 | +------------+---------------+---------------+---------------+----------------+----------------+----------------+ | pipe | 115MB/s | 293MB/s | 536MB/s | 855MB/s | 1770MB/s | 2743MB/s | | fifo | 123MB/s | 215MB/s | 418MB/s | 829MB/s | 1803MB/s | 2680MB/s | | socketpair | 125MB/s | 237MB/s | 479MB/s | 936MB/s | 1597MB/s | 2477MB/s | | uds | 115MB/s | 234MB/s | 508MB/s | 953MB/s | 1683MB/s | 2440MB/s | | tcp | 189MB/s | 353MB/s | 664MB/s | 1141MB/s | 1863MB/s | 2494MB/s | | shm | 16.609151MB/s | 32.209878MB/s | 62.803072MB/s | 123.633646MB/s | 242.465213MB/s | 479.693540MB/s | +------------+---------------+---------------+---------------+----------------+----------------+----------------+

KKKErde commented 2 years ago

同步导致的大量的cpu消耗。主要是信号量的获取\释放导致的。