Procedure to upload a program to Sextant
The steps we take to implement uploading a program to the Neo4j instance.
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- Patrick Stevens
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
-
Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Sprints
Whiteboard
Currently, we do the following with a parsed program:
Create the program node, storing its Neo4j ID; build a single query consisting of "for each function node, add it to the database along with its connections"; submit that query.
This is a little faster than the previous method ("use the REST API to make a separate 'create' request for each node and each relationship") due to the batching, but there is a large slowdown because now the Neo4j server has to do the following to input a relationship:
Search for the start function node; search for the end function node; create relationship
which it used not to have to do (previously, since Python knew the node IDs for every function node, the Neo4j server skipped the two searching steps above).
We could fix this by doing the following with a parsed program:
Create the program node, storing its Neo4j ID; build a single query consisting of "for each function node, add it to the database, return its ID", submit that query; then build a single query consisting of "for each relationship, add it to the database", and submit that.
This should be much faster: we now make only three requests to the server (program node, function nodes, function relationships), while the server never has to do any lookups because the Python client already knows which ID corresponds to each function node.