EricssonResearch / EricssonResearch/openwebrtc
libnice performance in networking I/O
- Dominant language
- C
- Stars
- 1.8k
- Forks
- 531
- PR merge metrics
- No merged PRs in 30d
Description
`configure --disable-assert` defines `NDEBUG`, which in turn is used in:
``` c
#ifdef NDEBUG
static inline gboolean nice_debug_is_enabled (void) { return FALSE; }
static inline void nice_debug (const char *fmt, ...) { }
#else
gboolean nice_debug_is_enabled (void);
void nice_debug (const char *fmt, ...) G_GNUC_PRINTF (1, 2);
#endif
```
`nice_debug` is being called repeatedly during network I/O in `agent_recv_message_unlocked`:
``` c
nice_debug ("%s: Received %d valid messages of length %" G_GSIZE_FORMAT
" from base socket %p.", G_STRFUNC, retval, message->length, nicesock);
```
Therefore, it will benefit performance to update the libnice recipe with `--disable-assert`. The calls to nice_debug take up 2% of out 13% CPU usage of iPhone 5s sending and receiving PCMA in loopback.
Contributor guide
Research direction
Start by locating the libnice recipe and its configure invocation, then review agent_recv_message_unlocked and the shown nice_debug call. Update the recipe to pass --disable-assert and verify that the build succeeds and the networking I/O path no longer incurs the described debug overhead.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking, performance
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100