Saturday, February 19, 2011

More fun with luajit and ffi: >300Kpps of UDP traffic

Today I added the UDP interface (rudimentary so far) to my experimental event loop.

In the github repo there is the code that simply echoes the UDP packet back.

For fun, I decided to wrap the sendto call into the cycle that repeats it 100000 times.

Here is the output:


23:26:52.988762 IP6 ::1.12345 > ::1.59283: UDP, length 4
23:26:52.988765 IP6 ::1.12345 > ::1.59283: UDP, length 4
23:26:52.988767 IP6 ::1.12345 > ::1.59283: UDP, length 4
23:26:52.988770 IP6 ::1.12345 > ::1.59283: UDP, length 4

This means that the luajit2+FFI can generate between 300Kpps and 500Kpps in UDP. Yay.

No comments: