Skip to content

Commit

Permalink
Bugfix for issue 33; reduce lock contention in Get(), parallel benchm…
Browse files Browse the repository at this point in the history
…arks.

- Fix for issue 33 (non-null-terminated result from
  leveldb_property_value())

- Support for running multiple instances of a benchmark in parallel.

- Reduce lock contention on Get():
  (1) Do not hold the lock while searching memtables.
  (2) Shard block and table caches 16-ways.

  Benchmark for evaluating this change:
  $ db_bench --benchmarks=fillseq1,readrandom --threads=$n
  (fillseq1 is a small hack to make sure fillseq runs once regardless
  of number of threads specified on the command line).



git-svn-id: https://leveldb.googlecode.com/svn/trunk@49 62dab493-f737-651d-591e-8d6aee1b9529
  • Loading branch information
[email protected] committed Aug 22, 2011
1 parent ab323f7 commit e3584f9
Show file tree
Hide file tree
Showing 7 changed files with 510 additions and 259 deletions.
3 changes: 2 additions & 1 deletion db/c.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ char* leveldb_property_value(
const char* propname) {
std::string tmp;
if (db->rep->GetProperty(Slice(propname), &tmp)) {
return CopyString(tmp);
// We use strdup() since we expect human readable output.
return strdup(tmp.c_str());
} else {
return NULL;
}
Expand Down
Loading

0 comments on commit e3584f9

Please sign in to comment.