Opened 12 years ago

Closed 12 years ago

#4160 defect closed duplicate (duplicate)

LineReceiver string buffering

Reported by: varela Owned by:
Priority: low Milestone:
Component: core Keywords:
Cc: Branch:


Some days ago I found that code in twisted.protocols.basic.LineReceiver is not good optimized. You used string adding in dataReceived function. But string is immutable object, so in each addition you create new instance of String. When line too large and data chunks very small it consume too much recourses. I've create test example with array buffers, you can found it in attach.

Attachments (1) (5.2 KB) - added by varela 12 years ago.
LineReceiver vs array buffering benchmark

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by varela

Attachment: added

LineReceiver vs array buffering benchmark

comment:1 Changed 12 years ago by Jean-Paul Calderone

Milestone: Twisted-9.0+1
Resolution: duplicate
Status: newclosed
Type: enhancementdefect

Duplicate of #2611.

comment:2 Changed 11 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.