Groups
Groups
Sign in
Groups
Groups
golang-dev
Conversations
About
Send feedback
Help
Re: code review 9118043: leveldb/db: concatenating and merging iterators. (issue 9118043)
59 views
Skip to first unread message
brad...@golang.org
unread,
May 7, 2013, 4:09:30 PM
5/7/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nige...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db.go
File leveldb/db/db.go (right):
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db.go#newcode259
leveldb/db/db.go:259: // Find the smallest key. We could maintain a heap
instead of doing
I think the heap way is actually simpler than this. And you ultimately
do fewer bytes.Compare operations if this is a heap.
See the latest version of the sstable merging iterator, which uses a
heap efficiently (related:
https://code.google.com/p/go/issues/detail?id=5372
) and only calls &
caches the sub-iterator.Key() when the subiterators are initialized or
advance.
https://codereview.appspot.com/9118043/
nige...@golang.org
unread,
May 7, 2013, 11:53:15 PM
5/7/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to brad...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
PTAL.
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db.go
File leveldb/db/db.go (right):
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db.go#newcode259
leveldb/db/db.go:259: // Find the smallest key. We could maintain a heap
instead of doing
On 2013/05/07 20:09:30, bradfitz wrote:
> I think the heap way is actually simpler than this.
Well, the C++ code just does a linear scan:
https://code.google.com/p/leveldb/source/browse/table/merger.cc#139
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db_test.go
File leveldb/db/db_test.go (right):
https://codereview.appspot.com/9118043/diff/5001/leveldb/db/db_test.go#newcode143
leveldb/db/db_test.go:143: // TODO: test all sub-iterators being empty.
These TODOs are now done.
https://codereview.appspot.com/9118043/
brad...@golang.org
unread,
May 8, 2013, 12:22:04 AM
5/8/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nige...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
LGTM
https://codereview.appspot.com/9118043/diff/11001/leveldb/db/db_test.go
File leveldb/db/db_test.go (right):
https://codereview.appspot.com/9118043/diff/11001/leveldb/db/db_test.go#newcode117
leveldb/db/db_test.go:117: b := bytes.NewBuffer(nil)
var b bytes.Buffer ?
https://codereview.appspot.com/9118043/diff/11001/leveldb/db/db_test.go#newcode120
leveldb/db/db_test.go:120: fmt.Fprintf(b, "<%s:%s>", iter.Key(),
iter.Value())
&b
https://codereview.appspot.com/9118043/diff/11001/leveldb/db/db_test.go#newcode123
leveldb/db/db_test.go:123: fmt.Fprintf(b, "err=%v", err)
&b
https://codereview.appspot.com/9118043/
nige...@golang.org
unread,
May 8, 2013, 12:29:05 PM
5/8/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nige...@golang.org, brad...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
*** Submitted as
https://code.google.com/p/leveldb-go/source/detail?r=47c9ec4eeea3
***
leveldb/db: concatenating and merging iterators.
R=bradfitz
CC=golang-dev
https://codereview.appspot.com/9118043
https://codereview.appspot.com/9118043/
Reply all
Reply to author
Forward
0 new messages