Here’s a code review:

sync.RWMutex works well as an embedded struct field. Locking DB could be 
db.Lock() instead of db.mu.Lock(), and the same could apply to other fields.

type DB struct {
    sync.RWMutex
…

type Options struct {
    BackgroundSyncInterval time.Duration
    fs.FileSystem
}

Seeing things like “db.metrics.BucketProbes.Add(1)” or 
“db.data.allocate(bucketSize)” seems excessive for Go; the struct embedding 
shortcuts help with readability.

Your error handling seems done well. Maybe consider making errFull or other 
global error vars public so a caller could do handling for more specific 
error conditions.

The benchmark graph seems to only have four samples for each. That may be 
reasonable but I’d generally expect a graph with more detail.

For the API, why are keys represented as []byte instead of string? Have you 
considered interface{} for keys and values?

The DB Open function documentation should say that a pogreb/fs.OS 
FileSystem is the default.

Overall this seems like a well written library to me after a quick look. 
There is a decent number of tests and documentation is there. 

Matt

On Monday, January 8, 2018 at 1:59:14 PM UTC-6, Artem Krylysov wrote:
>
> Hello everyone!
>
> I made a first release of a new key-value store optimized for fast random 
> lookups https://github.com/akrylysov/pogreb
>
> Random lookup performance benchmark results 
> https://akrylysov.github.io/pogreb/read-bench.png
>
> I will be happy to receive any feedback.
>
> Regards,
> Artem
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to