Commit Graph

993 Commits (c69165412dd95cf7baf22ed5aad16b4637bb1415)

Author SHA1 Message Date
Ben Johnson 30095231de README
Add limitation about multiple processes opening databases concurrently.
2016-12-21 08:52:12 -07:00
Josh Bleecher Snyder 4d8824b05d Don't allocate huge slices to merge pgids in freelist.write
Using a large (50gb) database with a read-write-delete heavy load,
nearly 100% of allocated space came from freelists.
1/3 came from freelist.release, 1/3 from freelist.write,
and 1/3 came from tx.allocate to make space for freelist.write.
In the case of freelist.write, the newly allocated giant slice gets
copied to the space prepared by tx.allocate and then discarded.

To avoid this, add func mergepgids that accepts a destination slice,
and use it in freelist.write.

This has a mild negative impact on the existing benchmarks,
but cuts allocated space in my real world db by over 30%.

name                      old time/op    new time/op    delta
_FreelistRelease10K-8       18.7µs ±10%    18.2µs ± 4%    ~             (p=0.548 n=5+5)
_FreelistRelease100K-8       233µs ± 5%     258µs ±20%    ~             (p=0.151 n=5+5)
_FreelistRelease1000K-8     3.34ms ± 8%    3.13ms ± 8%    ~             (p=0.151 n=5+5)
_FreelistRelease10000K-8    32.3ms ± 1%    32.2ms ± 7%    ~             (p=0.690 n=5+5)
DBBatchAutomatic-8          2.18ms ± 3%    2.19ms ± 4%    ~             (p=0.421 n=5+5)
DBBatchSingle-8              140ms ± 6%     140ms ± 4%    ~             (p=0.841 n=5+5)
DBBatchManual10x100-8       4.41ms ± 2%    4.37ms ± 3%    ~             (p=0.548 n=5+5)

name                      old alloc/op   new alloc/op   delta
_FreelistRelease10K-8       82.5kB ± 0%    82.5kB ± 0%    ~     (all samples are equal)
_FreelistRelease100K-8       805kB ± 0%     805kB ± 0%    ~     (all samples are equal)
_FreelistRelease1000K-8     8.05MB ± 0%    8.05MB ± 0%    ~     (all samples are equal)
_FreelistRelease10000K-8    80.4MB ± 0%    80.4MB ± 0%    ~             (p=1.000 n=5+5)
DBBatchAutomatic-8           384kB ± 0%     384kB ± 0%    ~             (p=0.095 n=5+5)
DBBatchSingle-8             17.2MB ± 1%    17.2MB ± 1%    ~             (p=0.310 n=5+5)
DBBatchManual10x100-8        908kB ± 0%     902kB ± 1%    ~             (p=0.730 n=4+5)

name                      old allocs/op  new allocs/op  delta
_FreelistRelease10K-8         5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease100K-8        5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease1000K-8       5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
_FreelistRelease10000K-8      5.00 ± 0%      5.00 ± 0%    ~     (all samples are equal)
DBBatchAutomatic-8           10.2k ± 0%     10.2k ± 0%  +0.07%          (p=0.032 n=5+5)
DBBatchSingle-8              58.6k ± 0%     59.6k ± 0%  +1.70%          (p=0.008 n=5+5)
DBBatchManual10x100-8        6.02k ± 0%     6.03k ± 0%  +0.17%          (p=0.029 n=4+4)
2016-12-20 14:32:15 -08:00
Ben Johnson d98e43f69e Merge pull request #618 from tbe/master
[ppc64] added missing variable
2016-12-20 07:40:02 -07:00
Bjørn Erik Pedersen 714f31f39e Fix prefix scan example
The example is correct in isolation, but if people just copy the loop, it will go into infinite loop when given an empty byte slice.
2016-12-06 21:38:41 +01:00
Ben Johnson 0d9f544bb9 Merge pull request #626 from timshannon/patch-1
Added BoltHold and Ironsmith to the projects list
2016-11-21 09:51:43 -07:00
Tim Shannon a8a17933aa Added BoltHold and Ironsmith to the projects list 2016-11-20 21:14:40 -06:00
Ben Aldrich ca9f2088aa replace unix implementation to be the same as solaris to fix an issue with glusterfs 2016-11-16 02:08:01 +00:00
Ben Johnson 315c65d4cf Merge pull request #621 from jcvernaleo/jcv_readme
Add btcwallet and dcrwallet to projects using bolt.
2016-11-09 15:02:51 -07:00
John C. Vernaleo 01cb4852fd Make wording a little less redundant. 2016-11-09 16:43:38 -05:00
John C. Vernaleo 021e7e8a8c Add btcwallet and dcrwallet to projects using bolt. 2016-11-08 08:39:53 -05:00
tbe 84658f4d37 [ppc64] added missing variable
The variable `brokenUnaligned` was missing for ppc64.
2016-11-04 12:25:04 +01:00
nick ac86fb9530 Fix return statement inside else block at the end of function and gofmt windows file
Signed-off-by: nick <nicholasjamesrusso@gmail.com>
2016-10-31 20:49:40 -07:00
Ben Johnson 4b1ebc1869 Merge pull request #611 from jaredfolkins/master
enhc: update example for nested buckets
2016-10-28 13:36:45 -06:00
Jared Folkins 5accf28dbd enhc: update example for nested buckets 2016-10-28 12:08:50 -07:00
Ben Johnson dca969723b Merge pull request #609 from hasit/patch-1
Add 'bolter' to the list of projects that use Bolt
2016-10-28 11:42:55 -06:00
Hasit Mistry 0ac07c81d0 Add 'bolter' to the list of projects that use Bolt
[bolter](https://github.com/hasit/bolter) is a command-line app for viewing BoltDB file in your terminal using [tablewriter](https://github.com/olekukonko/tablewriter).
2016-10-18 11:57:33 -07:00
Ben Johnson 074dffcc83 Merge pull request #605 from seeekr/patch-1
fix typo in README.md
2016-10-08 09:24:23 -06:00
Denis Andrejew 302d3d2ca3 fix typo in README.md 2016-10-07 22:35:08 +02:00
Ben Johnson f4c032d907 Merge pull request #604 from gopherpit/master
Add gopherpit to projects that use Bolt
2016-10-05 16:16:53 -06:00
Janoš Guljaš 573be28cf3 Add gopherpit to projects that use Bolt 2016-10-05 19:58:12 +02:00
Ben Johnson f0d021274d Merge pull request #601 from benbjohnson/stats-tx-n
Fix Stats.Sub() for Stats.TxN.
2016-10-03 13:08:47 -06:00
Ben Johnson 0d68f169c5
Fix Stats.Sub() for Stats.TxN.
The subtraction for `TxN` was previously transposed which caused
the result to be a negative number. This change alters the order
to return the correct (positive) result.
2016-10-03 13:04:32 -06:00
miao ef236228fa Avoid allocate a hole page, when the node size equals to pageSize 2016-09-25 00:55:55 +08:00
Ben Johnson fff57c100f Merge pull request #595 from namore/add_warning_foreach_keys
Update README.md
2016-09-13 10:53:39 -06:00
Roman Naumann 1e271f5035 Update README.md
Add warning to README.md that keys and values in `ForEach()` are
invalid outside of transaction.
2016-09-13 11:19:31 +02:00
Ben Johnson 9dffd9de3b Merge pull request #594 from anacrolix/patch-1
Update README.md
2016-09-12 10:49:43 -06:00
Ben Johnson ad29024c8a Merge pull request #591 from boltdb/readme
README
2016-09-08 10:33:36 -06:00
Ben Johnson 215223e6a9 README
Added note to README that the file format is fixed.
2016-09-08 10:32:55 -06:00
Ben Johnson e72f08ddb5 Merge pull request #561 from zhujun2006/master
task#560 print leaf k/v with right value
2016-09-06 14:09:29 -06:00
Ben Johnson de82765149 Merge pull request #578 from resin-os/align-fix
Correct broken unaligned load/store in armv5
2016-09-06 14:07:22 -06:00
Ben Johnson 1ff46c182d Merge pull request #590 from benbjohnson/vincent-petithory-compact-db
Compaction Command
2016-09-06 13:57:39 -06:00
Ben Johnson 1561ab171f Merge pull request #589 from nekto0n/master
Lower number of allocation in freelist.reindex()
2016-09-05 15:54:03 -06:00
Ben Johnson f5d275b537
Minor bolt compact revisions 2016-09-05 15:43:02 -06:00
Nikita Vetoshkin 3d34fbcbfb Lower number of allocation in freelist.reindex()
Here is a profile taken etcd.
Before:
     10924      10924 (flat, cum)  4.99% of Total
         .          .    230:
         .          .    231:// reindex rebuilds the free cache based on available and pending free lists.
         .          .    232:func (f *freelist) reindex() {
         .          .    233:	f.cache = make(map[pgid]bool)
         .          .    234:	for _, id := range f.ids {
     10924      10924    235:		f.cache[id] = true
         .          .    236:	}
         .          .    237:	for _, pendingIDs := range f.pending {
         .          .    238:		for _, pendingID := range pendingIDs {
         .          .    239:			f.cache[pendingID] = true
         .          .    240:		}
After:
         1          1 (flat, cum) 0.0017% of Total
         .          .    228:	f.reindex()
         .          .    229:
}         .          .    230:
         .          .    231:// reindex rebuilds the free cache based on available and pending free lists.
         .          .    232:func (f *freelist) reindex() {
         1          1    233:	f.cache = make(map[pgid]bool, len(f.ids))
         .          .    234:	for _, id := range f.ids {
         .          .    235:		f.cache[id] = true
         .          .    236:	}
         .          .    237:	for _, pendingIDs := range f.pending {
         .          .    238:		for _, pendingID := range pendingIDs {
2016-09-05 14:04:40 +05:00
Matt Joiner 8133f4399e Update README.md
Add anacrolix/torrent to users.
2016-09-02 15:19:24 +10:00
Ben Johnson 52d0f5e6a9
Merge branch 'compact-db' of https://github.com/vincent-petithory/bolt into vincent-petithory-compact-db 2016-09-01 14:47:06 -06:00
Ben Johnson ec58b76ba0 Merge pull request #577 from bouk/patch-1
Fix typo (Tx -> DB)
2016-08-31 16:25:56 -06:00
Ben Johnson 583e8937c6 Merge pull request #584 from benbjohnson/go17
Fix Go 1.7 pointer reference bug
2016-08-18 11:01:52 -06:00
Ben Johnson 92410e0673
fix Go 1.7 pointer reference bug
This commit fixes a bug where page end-of-header pointers were being
converted to byte slices even when the pointer did not point to
allocated memory. This occurs with pages that have a `page.count`
of zero.

Note: This was not an issue in Go 1.6 but the new Go 1.7 SSA backend
handles `nil` checks differently.

See https://github.com/golang/go/issues/16772
2016-08-18 08:44:57 -06:00
Ben Johnson 94c8db5968 Merge pull request #579 from asdine/master
Update description of project using BoltDB
2016-07-30 10:44:16 -04:00
Asdine El Hrychy 99f885d418 Update description of project using BoltDB 2016-07-30 12:06:00 +02:00
Lorenzo Stoakes 97aba5586d bucket: correct broken unaligned load/store in armv5
armv5 devices and older (i.e. <= arm9 generation) require addresses that are
stored to and loaded from to to be 4-byte aligned.

If this is not the case the lower 2 bits of the address are cleared and the load
is performed in an unexpected order, including up to 3 bytes of data located
prior to the address.

Inlined buckets are stored after their key in a page and since there is no
guarantee that the key will be of a length that is a multiple of 4, it is
possible for unaligned load/stores to occur when they are cast back to bucket
and page pointer types.

The fix adds a new field to track whether the current architecture exhibits this
issue, sets it on module load for ARM architectures, and then on bucket open, if
this field is set and the address is unaligned, a byte-by-byte copy of the
inlined bucket is performed.

Ref: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka15414.html
2016-07-28 14:25:49 +01:00
Bouke van der Bijl bb699ba24d Fix typo (Tx -> DB) 2016-07-22 13:08:01 -04:00
Ben Johnson 5cc10bbbc5 Merge pull request #573 from evnix/patch-1
added a BoltDB related project
2016-07-19 10:51:38 -06:00
Avinash D'Silva 318c587cae added a BoltDB related project 2016-07-17 22:11:04 +01:00
Ben Johnson acc803f0ce Merge pull request #567 from pankajkhairnar/pankajkhairnar-new-project
Added new project name in the list of projects using BoldDB
2016-07-07 10:56:50 -06:00
Ben Johnson c735b38f4e Merge pull request #570 from emersion/patch-1
Fixes build error in README code
2016-07-07 10:56:26 -06:00
emersion 2fcb4b2d24 Fixes build error in README code 2016-06-17 19:29:27 +02:00
Ben Johnson 3f7947a25d Merge pull request #569 from ifraixedes/patch-1
Remove skydb of the README
2016-06-16 13:33:16 -06:00
Ivan Fraixedes e2d1ba4e39 Remove skydb of the README
I think that SkyDB is over, I could find any link to the project.
2016-06-16 19:26:53 +02:00