[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [task #6935] Problems to be solved with the current socket/

From: Frédéric Bernon
Subject: [lwip-devel] [task #6935] Problems to be solved with the current socket/netconn API
Date: Sat, 26 May 2007 13:51:18 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv: Gecko/20070309 Firefox/

Follow-up Comment #9, task #6935 (project lwip):

Some statistics I get about "redesign socket api". I join some part of the
code I patch to test that, but it's not a "patch file" (just some part to
show differences).

The test is based on a simple "while(1) sendto( s, data, 1458, 0, (struct
sockaddr *)&saRemote, sizeof(saRemote));" (using a measure performance tools
for NXP, a little bit intrusive, so, these stats are more to give you some
ideas of gain)...
Statistics: a lwip_sendto take ~0.204ms, the udp_sendtto part

SOLUTION1: "always use netconn_sendto, but add a global mutex to replace
Statistics: a lwip_sendto take ~0.117ms, the udp_sendtto part

SOLUTION2: SOLUTION1 patchs+"directly use udp_sendto, and the global mutex"
Statistics: a lwip_sendto take ~0.076ms, the udp_sendtto part

Conclusion: from current CVS code, it seems we can get easily a very
important gain of performance (from 0.204ms to 0.076, so, a ratio ~2.7). For
sockets layer user, we could also gain an independancy from netconn (like in
solution2): we could avoid netbuf use, api_msg preparation, and we could
reduce the footprint.

But some problems I see with the global mutex solution: it a task with a
"low" priority lock the core to do any action (a send by example), and if
others tasks in the system with higher performance run, and often preempt it,
the global perf of the stack can decrease (because the perf is not only based
on the tcpip_thread priority, but on the time during the core is locked).

Comments ? Atte, Simon, I will be interested about stats with such patchs...

(file #12864)

Additional Item Attachment:

File name: API Layers measures.txt        Size:4 KB


Reply to this item at:


  Message posté via/par Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]