Implemention:copy-out vs. zero-copy


#1

I note your comment:The data is copy-out; support zero-copy? in graph.cc.


Can you explain the difference between them? (copy-out vs zero-copy)


#2

Hi, the first one is a note and the second one should be a TODO. You can see when Graph::Successors is called, a new IdArray is created, which means the successor node ids are copied to it. We are thinking about doing zero-copy here (simply return the pointer to the internal storage), which should be much faster. However, we are not sure how to do this cleanly. For example, what if the graph structure is mutated after the return? Who should be in charge of the ownership? so on an so forth.