Ticket #1742 (closed patch: fixed)

Opened 11 years ago

Last modified 11 years ago

Skip compact_pool if all blocks are almost full

Reported by: nwellnhof Owned by:
Priority: normal Milestone:
Component: GC Version: 2.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: new Platform:

Description

If all blocks except the top block are almost full, compacting isn't needed. The attached patch makes compact_pool return early in this case.

Also, pad_pool_size currently includes pools that are almost full. This means that more memory is allocated than needed. It isn't a big problem because most of the time the memory will be used sooner or later, but it's cleaner to account for the almost full blocks here.

Plus a micro optimization in is_block_almost_full.

Attachments

compact-pool.diff Download (2.5 KB) - added by nwellnhof 11 years ago.
compact-pool-fix.diff Download (1.0 KB) - added by nwellnhof 11 years ago.

Change History

Changed 11 years ago by nwellnhof

Changed 11 years ago by chromatic

On Friday 13 August 2010 at 15:31, Parrot  wrote:

>  If all blocks except the top block are almost full, compacting isn't
>  needed. The attached patch makes compact_pool return early in this case.
> 
>  Also, pad_pool_size currently includes pools that are almost full. This
>  means that more memory is allocated than needed. It isn't a big problem
>  because most of the time the memory will be used sooner or later, but it's
>  cleaner to account for the almost full blocks here.
> 
>  Plus a micro optimization in is_block_almost_full.

The patch seems to do good things for me with Rakudo.  The startup improvement 
is small, but I can measure its positive effects.

-- c 

Changed 11 years ago by nwellnhof

It seems that my patch skips compacting if there are only completely empty memory blocks and almost full blocks. In this case the completely empty blocks should be freed. Here is a fix on top of the first patch.

Changed 11 years ago by nwellnhof

Changed 11 years ago by chromatic

  • status changed from new to closed
  • resolution set to fixed

Thanks, applied as r48566.

Note: See TracTickets for help on using tickets.