From def455554b5607ec6ccd0af51d0dea5401003e93 Mon Sep 17 00:00:00 2001 From: Ben Johnson Date: Mon, 30 Jun 2014 08:01:41 -0600 Subject: Add freelist cache. This commit adds a cache to the freelist which combines the available free pages and pending free pages in a single map. This was added to improve performance where freelist.isFree() was consuming 70% of CPU time for large freelists. --- tx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tx.go') diff --git a/tx.go b/tx.go index d8ffc08..5eada65 100644 --- a/tx.go +++ b/tx.go @@ -496,7 +496,7 @@ func (tx *Tx) Page(id int) (*PageInfo, error) { } // Determine the type (or if it's free). - if tx.db.freelist.isFree(pgid(id)) { + if tx.db.freelist.freed(pgid(id)) { info.Type = "free" } else { info.Type = p.typ() -- cgit v1.2.3