Skip to content

current package layout hurts compile time and binary sizes #113

@mvdan

Description

@mvdan

Since all the DB libraries are imported from a single package, using a single one of them requires building all of them. And since each is registered globally, they must be bundled in the final binary too.

This will get worse as more DB implementations are added (#38). I made a write-up about this, and potential solutions, on ChainSafe/chaindb#2 since that module has a similar issue.

Similarly, I think a database implementation called foo should live at github.com/tendermint/tm-db/foo. Then, to use it, one would need to call a constructor like foo.New(...) instead of db.NewDB("foo", ...). This way, because the user only imports the database implementations they need, Go only builds and links the libraries as needed, not all of them at once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions