Commit Graph

19 Commits (26d9d16a46cc33fb09d4f80fab1715d71b426021)

Author SHA1 Message Date
Martin Kobetic 04a3e85793 Merge sorted pgids rather than resorting everything 2015-06-16 13:48:54 -06:00
Ben Johnson b4d00c394a Expand assertion statements.
This commit expands calls to _assert() that use variadic arguments. These calls require conversion to interface{} so there
was a large number of calls to Go's internal convT2E() function. In some profiling this was taking over 20% of total runtime.
I don't remember seeing this before Go 1.4 so perhaps something has changed.
2015-01-30 14:15:49 -05:00
Ben Johnson ce0754b0d3 Allow freelist overflow.
This commit is a backwards compatible change that allows the freelist to overflow the
page.count (uint16). It works by checking if the overflow will occur and marking the
page.count as 0xFFFF and setting the actual count to the first element of the freelist.

This approach was used because it's backwards compatible and it doesn't make sense to
change the data type of all page counts when only the freelist's page can overflow.

Fixes #192.
2014-07-10 14:50:21 -06:00
Ben Johnson 333c586ed0 Clean up freelist reindex. 2014-07-10 14:16:26 -06:00
Ben Johnson def455554b 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.
2014-06-30 08:01:41 -06:00
Ben Johnson 642b104396 Add DefaultOptions variable.
This commit adds an explicit DefaultOptions variable for additional documentation.
Open() can still be passed a nil options which will cause options to be change to
the DefaultOptions variable. This change also allows options to be set globally for
an application if more than one database is being opened in a process.

This commit also moves all errors to errors.go so that the godoc groups them together.
2014-06-22 12:44:20 -06:00
Martin Kobetic 571f201672 split the freelist page count stats to free and pending 2014-06-20 14:53:25 +00:00
Martin Kobetic c105316292 add freelist stats to db stats 2014-06-17 18:40:56 +00:00
Ben Johnson 4db99647eb Fix freelist rollback. 2014-06-13 15:50:47 -06:00
Ben Johnson f448639ce4 Check for freelist overflow. 2014-06-13 07:56:10 -06:00
Ben Johnson 2eaf8f7ce0 Add freelist assertion on every free().
This commit performs a check on the freelist pages to ensure that a double free can never happen.
2014-05-29 08:02:15 -06:00
Ben Johnson 12b36fe70c Fix freelist allocate(). 2014-05-19 14:11:32 -06:00
Ben Johnson 782ead0dbf Fix freelist allocation direction.
This commit fixes the freelist so that it frees from the beginning of the data file
instead of the end. It also adds a fast path for pages which can be allocated from
the first free pages and it includes read transaction stats.
2014-05-19 12:08:33 -06:00
Ben Johnson 698b07b074 Add nested buckets.
This commit adds the ability to create buckets inside of other buckets.
It also replaces the buckets page with a root bucket.

Fixes #56.
2014-04-11 12:36:54 -06:00
Ben Johnson 440b89418f Write freelist after each commit.
Well, this is embarassing. Somehow the freelist was never getting written after each commit.
This commit fixes that and fixes a small reporting issue with "bolt pages".
2014-03-31 08:52:19 -06:00
Ben Johnson 0e4d77d424 Add 'bolt pages'. 2014-03-21 22:34:54 -06:00
Ben Johnson 57376f0905 Rename Transaction to Tx.
I changed the Transaction/RWTransaction types to Tx/RWTx, respectively. This makes the naming
more consistent with other packages such as database/sql. The txnid is changed to txid as well.
2014-03-08 17:04:02 -07:00
Ben Johnson 8ad59edd02 API Documentation. 2014-02-13 10:58:27 -07:00
Ben Johnson 509e93dff4 Add freelist. 2014-02-10 14:04:01 -07:00