feat: edge neighbour sort - #2689
Open
louisch wants to merge 9 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.
| Benchmark suite | Current: 03d30e3 | Previous: 9823ef7 | Ratio |
|---|---|---|---|
lotr_graph/num_edges |
4 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph/num_nodes |
6 ns/iter (± 0) |
1 ns/iter (± 0) |
6 |
lotr_graph/graph_latest |
3 ns/iter (± 0) |
0 ns/iter (± 0) |
+∞ |
lotr_graph_materialise/materialize |
7838110 ns/iter (± 74379) |
1564816 ns/iter (± 35303) |
5.01 |
lotr_graph_window_100/num_nodes |
15 ns/iter (± 0) |
5 ns/iter (± 0) |
3 |
lotr_graph_window_100_materialise/materialize |
8171452 ns/iter (± 61417) |
1669150 ns/iter (± 10700) |
4.90 |
lotr_graph_window_10/has_node_existing |
134 ns/iter (± 9) |
62 ns/iter (± 11) |
2.16 |
lotr_graph_window_10_materialise/materialize |
3423478 ns/iter (± 20068) |
971980 ns/iter (± 4278) |
3.52 |
lotr_graph_subgraph_10pc_materialise/materialize |
2068832 ns/iter (± 15680) |
334634 ns/iter (± 1287) |
6.18 |
lotr_graph_subgraph_10pc_windowed/has_node_existing |
139 ns/iter (± 11) |
62 ns/iter (± 14) |
2.24 |
lotr_graph_subgraph_10pc_windowed_materialise/materialize |
1259051 ns/iter (± 13585) |
230399 ns/iter (± 2617) |
5.46 |
lotr_graph_window_50_layered/num_edges_temporal |
143109 ns/iter (± 2688) |
70121 ns/iter (± 7586) |
2.04 |
lotr_graph_window_50_layered/has_node_existing |
374 ns/iter (± 23) |
129 ns/iter (± 12) |
2.90 |
lotr_graph_window_50_layered/graph_latest |
82969 ns/iter (± 1601) |
36649 ns/iter (± 916) |
2.26 |
lotr_graph_window_50_layered_materialise/materialize |
28911871 ns/iter (± 103956) |
3488825 ns/iter (± 24948) |
8.29 |
lotr_graph_persistent_window_50_layered/num_edges_temporal |
583790 ns/iter (± 12810) |
192686 ns/iter (± 1569) |
3.03 |
lotr_graph_persistent_window_50_layered/has_node_existing |
413 ns/iter (± 352) |
174 ns/iter (± 83) |
2.37 |
lotr_graph_persistent_window_50_layered/graph_latest |
130282 ns/iter (± 7260) |
57549 ns/iter (± 4809) |
2.26 |
lotr_graph_persistent_window_50_layered_materialise/materialize |
50254683 ns/iter (± 979480) |
5298035 ns/iter (± 147912) |
9.49 |
This comment was automatically generated by workflow using github-action-benchmark.
ljeub-pometry
self-requested a review
July 31, 2026 08:19
ljeub-pometry
requested changes
Jul 31, 2026
ljeub-pometry
left a comment
Collaborator
There was a problem hiding this comment.
The src and dst options for edge sorting should also take a NodeSortBy (especially useful for graph-level edges)
Comment on lines
+10
to
+13
| pub src: Option<bool>, | ||
| /// Destination | ||
| pub dst: Option<bool>, | ||
| /// Sort by the neighbour node (the endpoint that is NOT the node these |
Collaborator
There was a problem hiding this comment.
Shouldn't these also take a NodeSortBy? Otherwise, you can't sort a graph-level edge collection by src...
Keep the identity-related keys (id, name) adjacent, ahead of type. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses review feedback: src/dst previously accepted only a bool (sort by
node id). Making them Option<NodeSortBy> lets graph-level edge collections
sort by the src/dst node's type/name/property, and unifies all three node
keys (src/dst/neighbour) through compare_node. Breaking schema change:
{ src: true } becomes { src: { id: true } }.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ljeub-pometry
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changes were proposed in this pull request?
typeandnamesorting to NodeSortBy in raphtory-graphqlWhy are the changes needed?
In the UI I'd like to be able to do a sort of exploded edges by the neighbours that they connect to, then page. The only thing missing was a way for the edge sort to be able to sort by the neighbours that they connect to.
Does this PR introduce any user-facing change? If yes is this documented?
Yes, it's new API endpoints. Docs added above each endpoint function.
How was this patch tested?
Tests added for type sorting, and sorting edges by their neighbours
Are there any further changes required?
No