Skip to content

Conversation

@zhimingwang36
Copy link

duplicateNodes() is quite hot in graph.finalize() code path.

Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handler.cpp looks ok.

MRecordingQueues.erase(RecordingQueue.weak_from_this());
}

void graph_impl::endRecording() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why is it called "endRecording". It just checks of there is a single queue and it is in-order-queue. How does it reflect the naming?

Copy link
Author

@zhimingwang36 zhimingwang36 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is to cover work to be done at the time of ending Graph recording, like current collecting attribute(s) of the Graph before MRecordingQueues is destroyed. The right time to collect some attribute(s) of the recorded Graph is endRecording time.


void graph_impl::endRecording() {
if (MRecordingQueues.size() == 1) {
MIsLinearRecorded = MRecordingQueues.begin()->lock()->isInOrder();
Copy link
Contributor

@KseniyaTikhomirova KseniyaTikhomirova Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MRecordingQueues stores weak pointers. Technically there is a chance you can get (nullptr)->isInOrder().

Copy link
Author

@zhimingwang36 zhimingwang36 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will add a checker here. [Addressed]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants