Skip to content

Conversation

cbouilla
Copy link

@cbouilla cbouilla commented Jun 5, 2018

When a Bitmain device reports a nonce, it also return a work_id. The cgpu_info object contains a queue of "in flight" work items, in a uthash hash table. Ultimately, the __find_work_byid function is used to locate the work item with the given id in this hash table. It does this... by iterating over the hash table, although the ids are used as hash keys!

This PR replaces iteration over the whole hash table by direct access to the right element, using the hash. It reduces CPU use when mining at very low difficulty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant