8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00

Optimization: delay clearing of page_full flag until page have at least 25% of free space. It saves few costly mark_full() calls when space is actively allocated and reclaimed in highly concurrent environment and reduces PP contention.

This commit is contained in:
hvlad 2013-03-21 08:23:39 +00:00
parent 0ee91bc2c6
commit a418373026

View File

@ -744,6 +744,22 @@ void DPM_delete( thread_db* tdbb, record_param* rpb, ULONG prior_page)
if (count && (page->dpg_header.pag_flags & dpg_full))
{
// hvlad: delay clearing of page_full flag until page have at least 25%
// of free space. It saves few costly mark_full() calls when space is
// actively allocated and reclaimed in highly concurrent environment
// and reduces PP contention.
int used = HIGH_WATER(page->dpg_count);
for (int i = 0; i < count; i++)
if (page->dpg_rpt[i].dpg_offset)
used += ROUNDUP(page->dpg_rpt[i].dpg_length, ODS_ALIGNMENT);
if (used >= (dbb->dbb_page_size * 3 / 4))
{
CCH_RELEASE(tdbb, window);
return;
}
DEBUG
page->dpg_header.pag_flags &= ~dpg_full;
mark_full(tdbb, rpb);