Skip to content

Enable usleep support #285

Closed
Closed
@jmmv

Description

@jmmv

I've been trying to use these SQLite bindings for Golang and been observing that my queries pause frequently for a significant amount of time. Given enough contention accessing the database, the whole app grinds to a halt.

I thought I had a deadlock somewhere, but I think the cause is simpler and this online post http://beets.io/blog/sqlite-nightmare.html helped me track it down.

Basically, it seems to me that sqlite is being compiled without usleep support, which means that any backoff during contention incurs a significant penalty. Inspecting the code, I do not see HAVE_USLEEP=1 being defined anywhere in this codebase.

Setting -DHAVE_USLEEP=1 in the #cgo stanza of sqlite3.go should be sufficient, though I don't know if that's going to break any supported platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions