At beginning, the programe can only achieve 1.7Mbps under stress test after adding new features.
1.perf stat
$ sudo perf stat -p 27357
^C
Performance counter stats for process id '27357':
2120.354507 task-clock (msec) # 0.013 CPUs utilized
49,511 context-switches # 0.023 M/sec
2,721 cpu-migrations # 0.001 M/sec
381 page-faults # 0.180 K/sec
6,829,748,878 cycles # 3.221 GHz
9,502,643,618 instructions # 1.39 insn per cycle
2,051,685,449 branches # 967.614 M/sec
17,001,834 branch-misses # 0.83% of all branches
169.205295094 seconds time elapsed
It indicates that this doesn’t seem to be a CPU-bound problem as the value of task-clock (msec) for CPU-bound one can achive almost 1[1].
2.perf top
$ sudo perf top -p 27357
3.perf record && perf report
sudo perf record -g -F 50000 -e cpu-clock -p 27357
A file named perf.data is generated.
sudo perf report -i perf.data
4.References
1.https://www.ibm.com/developerworks/cn/linux/l-cn-perf1/index.html
2. http://www.blogjava.net/qileilove/archive/2013/09/04/403646.html
3. https://www.cnblogs.com/happyliu/p/6142929.html