Is it noticably more efficient to cache direct-memory arrays such as ts.nodes_time
?
#3064
-
I'm quite often looking up node times in a tree sequence, which can be accessed using parent_times = ts.nodes_time[ts.edges_parent]
child_times = ts.nodes_time[ts.edges_child]
# Or is this a lot more efficient?
nodes_time = ts.nodes_time
parent_times = nodes_time[ts.edges_parent]
child_times = nodes_time[ts.edges_child] |
Beta Was this translation helpful? Give feedback.
Answered by
jeromekelleher
Nov 25, 2024
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There wouldn't be much in it here.
It does make a substantial difference when accessing table columns, which superficially looks the same but involves full copies.