Skip to content

use sync.Pool to optimize db.Put operation #235

@roseduan

Description

@roseduan

Now the db.Put operation will create a new batch every time, which may cause too much memory allocation.
We can use sync.Pool to avoid this.

The goleveldb has done this, see https://github.com/syndtr/goleveldb/blob/master/leveldb/db_write.go#L362

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions