Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm addressing multiple issues here:
setAndGetWorkspace
request. That takes around 3 seconds. That's long enough that you start clicking on more things, creating an increasing backlog of requests. In my test I got 20–30 second response times easily.For the third issue 4 of the 6 VertexToEdgeAttribute operations were unnecessarily caused by the
defaultTableName
code. That's easy to fix. But the other two are unavoidable if we execute the box.So I've added a "BoxCache" to avoid unnecessary box executions. This is a huge improvement. Even if you only moved a box, we used to execute all the boxes in the workspace. But with the cache we don't execute anything and it's super fast. When you change something, we only execute that one box.
I went with this universal solution rather than try to improve the SQL box code, because it's not the only box that scales linearly with the number of attributes. E.g. a filter box will pull over all attributes. It's a bit faster than the SQL box, but I still saw 1–2 second latencies with 100 attributes and 20 filter boxes. The cache fixes this for all boxes.
Do you see any potential issues with it?