Opened 8 years ago

Closed 8 years ago

#4160 defect closed duplicate (duplicate)

LineReceiver string buffering

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

Description

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)

_.py (5.2 KB) - added by varela 8 years ago.
LineReceiver vs array buffering benchmark

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by varela

Attachment: _.py added

LineReceiver vs array buffering benchmark

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

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

Duplicate of #2611.

comment:2 Changed 7 years ago by <automation>

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