myspace protocol performance improvement: call strlen outside of loop in msim_unescape
|Reported by:||oliver||Owned by:||jeff|
In message.c in the escape & unescape functions the loops are not optimal,
doing a strlen() for each character in the message string.
valgrind/callgrind identified especially msim_unescape() as a expensive because of that (guess there is more unescaping going on than escaping).
The attached patch moves the strlen() out of the loop header for both functions.
Change History (4)
Changed 9 years ago by oliver
comment:1 Changed 9 years ago by jeff
- Resolution set to fixed
- Status changed from new to closed
- Summary changed from myspace protocol performance improvement to myspace protocol performance improvement: call strlen outside of loop in msim_unescape