Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#4790 closed patch (fixed)

myspace protocol performance improvement: call strlen outside of loop in msim_unescape

Reported by: oliver Owned by: jeff
Milestone: 2.4.0 Component: MySpace
Version: 2.3.1 Keywords:
Cc:

Description

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.

Attachments (1)

myspace_1.patch (1003 bytes) - added by oliver 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by oliver

comment:1 Changed 10 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

comment:2 Changed 10 years ago by jeff2@…

  • Milestone set to 2.3.2

(In 72a2b71dfe259097d115f67e0442fb44934ce686) Patch from oliver:

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.

Closes #4790.

comment:3 Changed 10 years ago by QuLogic

  • Milestone changed from 2.3.2 to 2.4.0
Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!