# shm使用说明

### shm演示

### 性能测试

shm性能测试报告

> OS： ubuntu 20.04 Desktop

> CPU：海光3330E

> 内存：16G

> 内核：Linux sinsegye-Hygon 5.15.51-sinsegye-xenomai3

> Gcc: 9.4.0

> Iceoryx： v2.0.3

### 测试IPC通讯延时

> 使用iceorxy

##### Measurement Result

100000 round trips for each payload.

Payload Size [kB] | Average Latency [µs]
--- | ---
1 | 3.3
2 | 3.6
4 | 3.6
8 | 3.6
16 | 3.6
32 | 3.6
64 | 3.6
128 | 3.6
256 | 3.6
512 | 3.6
1024 | 3.6
2048 | 3.6
4096 | 3.6

> Finished!

> 使用UNIX DOMAIN SOCKET

> ****** UNIX DOMAIN SOCKET ********

> waiting for follower

> Measurement for: 1 kB, 2 kB, 4 kB, 8 kB, 16 kB, 32 kB, 64 kB, 128 kB, 256 kB, 512 kB, 1024 kB, 2048 kB, 4096 kB

##### Measurement Result

100000 round trips for each payload.

Payload Size [kB] | Average Latency [µs]
--- | ---
1 | 6.1
2 | 8.5
4 | 11
8 | 14
16 | 25
32 | 48
64 | 92
128 | 1.8e+02
256 | 2.5e+02
512 | 6.9e+02
1024 | 1e+03
2048 | 2.8e+03
4096 | 5.3e+03

> Finished!

> 使用消息队列

> ****** MESSAGE QUEUE ********

> waiting for follower

> Measurement for: 1 kB, 2 kB, 4 kB, 8 kB, 16 kB, 32 kB, 64 kB, 128 kB, 256 kB, 512 kB, 1024 kB, 2048 kB, 4096 kB

##### Measurement Result

100000 round trips for each payload.

Payload Size [kB] | Average Latency [µs]
--- | ---
1 | 4.2
2 | 6.7
4 | 7.1
8 | 10
16 | 17
32 | 32
64 | 61
128 | 1e+02
256 | 2.3e+02
512 | 4.6e+02
1024 | 9.1e+02
2048 | 1.8e+03
4096 | 3.4e+03

> Finished!

#### 测试满负载IPC通讯延时

> 使用iceorxy：

> ****** ICEORYX ********

> Waiting for: subscription, subscriber [ success ]

> Measurement for: 1 kB, 2 kB, 4 kB, 8 kB, 16 kB, 32 kB, 64 kB, 128 kB, 256 kB, 512 kB, 1024 kB, 2048 kB, 4096 kB

> Waiting for: unsubscribe [ finished ]

##### Measurement Result

100000 round trips for each payload.

Payload Size [kB] | Average Latency [µs]
--- | ---
1 | 28
2 | 28
4 | 31
8 | 29
16 | 41
32 | 23
64 | 20
128 | 23
256 | 32
512 | 19
1024 | 27
2048 | 23
4096 | 25