-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlchemiscaleClient
get_tasks_status
and set_tasks_status
slow for many tasks
#148
Comments
@hmacdope can you drop any findings you come across on this question here? |
Google Firebase and Compute seem to have batching for their endpoints while also supporting Mailchimp also seems to have an async batched workflow as does Meta's ad REST API . Some info on doing batching within Neo4j queries themselves is here and here IMO second one is better. These make heavy use of Another (IMO great) option is to use CALL apoc.periodic.iterate(
"UNWIND $nodes AS node
RETURN node",
"MATCH (n:Label {id: node.id})
SET n.property = node.property",
{batchSize: 100, parallel: true, params: {nodes: $nodeList}}
) |
This may require the official drivers rather than # Assuming you have a list of unique IDs
id_list = [1, 2, 3, 4]
# Connect to Neo4j
driver = GraphDatabase.driver("bolt://localhost:7687", auth=("neo4j", "password"))
# Execute the Cypher query
with driver.session() as session:
result = session.run("MATCH (n:Label) WHERE n.id IN $idList RETURN n", idList=id_list)
nodes = result.data()
# Print the retrieved nodes
for node in nodes:
print(node) May work according to Copilot X |
I will say that most of the batched APIs have a hardcoded limit on the batchsize. |
Awesome, thanks for these notes @hmacdope! This is great fodder for a decision on how to proceed for these methods. |
Closed by #150. |
When trying to reset many tasks, e.g. 1000, from
error
towaiting
, it can take quite a bit of time to useget_tasks_status
andset_tasks_status
to achieve this. These methods currently loop through all theTask
ScopedKey
s they are given one at a time to perform their operations.We should identify ways to speed this up, including:
The text was updated successfully, but these errors were encountered: