Opened 18 years ago

Closed 18 years ago

#1433 closed enhancement (fixed)

pespacket.cpp Allocator optimization

Reported by: Janne <janne-mythtv@…> Owned by: danielk
Priority: minor Milestone: unknown
Component: dvb Version:
Severity: medium Keywords:
Cc: Ticket locked: no

Description

With [9223] 2/3 of the time of ParseTable was spent in get_{188|4096}_block, since ~80% of the calls actually do memory allocation.

The attached patch halves the size of the blocks, unrolls a expensive vector method from the inner loop and frees the allocators only if more than one block was allocated.

The last point is probably the simplest compromise between saving memory allocations and smallest memory footprint.

With the patch get_{188|4096}_block drops to 3%, and the ratio of calls with memory allocation drops under 1%.

Attachments (2)

pespacket_block_allocation.patch (1.9 KB) - added by Janne <janne-mythtv@…> 18 years ago.
pespacket_fix.patch (1.2 KB) - added by Janne <janne-mythtv@…> 18 years ago.

Download all attachments as: .zip

Change History (5)

Changed 18 years ago by Janne <janne-mythtv@…>

comment:1 Changed 18 years ago by danielk

Resolution: fixed
Status: newclosed

(In [9238]) Closes #1433, by applying patch.

This tweaks some params in the pes memory allocator to get a big bump in performace.

The method causing most of the allocations will actually be a zero memory copy routine when the SIParser refactor is done, but these optimizations will still be useful for when we need to clone tables.

Changed 18 years ago by Janne <janne-mythtv@…>

Attachment: pespacket_fix.patch added

comment:2 Changed 18 years ago by Janne <janne-mythtv@…>

Resolution: fixed
Status: closedreopened

The pespacket_fix patch adds also the last returned block to to available blocks if the allocator holds only one unit.

sorry, seen this error only after the commit

comment:3 Changed 18 years ago by danielk

Resolution: fixed
Status: reopenedclosed

(In [9240]) Closes #1433, by applying fix patch. The patch in [9238] leaked some memory.

Note: See TracTickets for help on using tickets.