Opened 12 years ago

Closed 12 years ago

#2958 closed Enhancement (invalid)

Minimize use of tr_ptrArray in certain critical parts of the code

Reported by: wereHamster Owned by: charles
Priority: Normal Milestone: None Set
Component: libtransmission Version: 1.91
Severity: Normal Keywords: needinfo
Cc: tom@…


Some parts (most prominent in bandwidth.c, but other parts are affected as well) create and destroy ptr arrays many times a second. And due to how the ptr array manages memory that can lead to noticeable slowdowns (up to a point where most of the time is spent with managing memory rather than servicing network sockets).

Try to minimize use of tr_ptrArray in parts where other data structure (lists, hash tables etc) make more sense.

Attachments (1)

faster-tr_ptrArrayAppend.patch (858 bytes) - added by sadface 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by charles

  • Keywords needinfo added

I'm open to this idea, but do you have any profiling data that shows where transmission is spending most of its time managing memory instead of servicing network sockets?

comment:2 Changed 12 years ago by sadface

I don't bring you a revolutionary data structure. It's just a minimal patch for tr_ptrArray...

Changed 12 years ago by sadface

comment:3 Changed 12 years ago by livings124

In the end will that have any impact? It's just avoiding a memmove of 0.

comment:4 Changed 12 years ago by charles

It makes the code a little cleaner anyway, regardless of whether memmove(a,b,0) is free or not..

comment:5 Changed 12 years ago by charles

Accepted to 1.9x in r10348

Accepted to trunk in r10349

comment:6 Changed 12 years ago by charles

  • Resolution set to invalid
  • Status changed from new to closed

Closing due to lack of information on the cost of tr_ptrArray. Please feel free to reopen this ticket when more information is available.

Note: See TracTickets for help on using tickets.