rigtorp / ipc-bench Goto Github PK
View Code? Open in Web Editor NEWLatency benchmarks of Unix IPC mechanisms
License: MIT License
Latency benchmarks of Unix IPC mechanisms
License: MIT License
can you please add some benchmarks for unix datagram sockets?
I know that in issue #13 you stated that you have no results to share but please consider adding a section to the README showing some example results the next time you test this code. From my understanding these are tests run on Linux. This repository is starred more than 500 times so clearly there is some interest in this.
the test is using blocking API(read/write),what if using noblock?
The linker causes an error when it is called for shm.c
Error message:
cc -g -lrt shm.c -o shm
shm.c: In function ‘main’:
shm.c:96:9: warning: format ‘%lli’ expects argument of type ‘long long int’, but argument 2 has type ‘int64_t’ [-Wformat]
shm.c:96:9: warning: format ‘%lli’ expects argument of type ‘long long int’, but argument 3 has type ‘int64_t’ [-Wformat]
shm.c:96:9: warning: format ‘%lli’ expects argument of type ‘long long int’, but argument 4 has type ‘int64_t’ [-Wformat]
/tmp/ccsPjw4i.o: In function main': /home/ncoretti/ipc-bench/shm.c:56: undefined reference to
clock_gettime'
/home/ncoretti/ipc-bench/shm.c:82: undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make: *** [shm] Error 1
Tested on:
Linux VIGEMDT11 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Steps to reproduce the error:
Please do you have any benchmark result to share?
And why not use shared memory as IPC? It should have the lowest latency.
On 32 bit ARM delta calculation shall be as this:
delta = ((stop.tv_sec - start.tv_sec) * 1000000000LL +
(stop.tv_nsec - start.tv_nsec));
and
delta = (stop.tv_sec - start.tv_sec) * 1000000000LL +
(stop.tv_usec - start.tv_usec) * 1000LL;
Otherwise the expression overflows, because long
is 4 byte in size and by default literals are int
.
It was like a time travel, negative latency 😃
Target shm
does not compile
% make
cc -g -Wall -O3 pipe_lat.c -o pipe_lat
cc -g -Wall -O3 pipe_thr.c -o pipe_thr
cc -g -Wall -O3 unix_lat.c -o unix_lat
cc -g -Wall -O3 unix_thr.c -o unix_thr
cc -g -Wall -O3 tcp_lat.c -o tcp_lat
cc -g -Wall -O3 tcp_thr.c -o tcp_thr
cc -g -Wall -O3 tcp_local_lat.c -o tcp_local_lat
cc -g -Wall -O3 tcp_remote_lat.c -o tcp_remote_lat
make: *** No rule to make target 'shm', needed by 'all'. Stop.
I always get 1us latency for small packets.
I've made a local hack to cast delta
as double, and actual value is 1.6us on my machine.
Perhaps it's something to consider?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.