Skip to content

Conversation

@nurmohammed840
Copy link

No description provided.

Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

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

Do you have any benchmark results against this? It'd be great if we could have cofidence on this change.

Comment on lines -65 to +72
self.waker.take()
unsafe { (*self.waker.get()).take() }
Copy link
Member

Choose a reason for hiding this comment

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

Safety note should be added.

@nurmohammed840
Copy link
Author

nurmohammed840 commented Jan 12, 2026

Do you have any benchmark results against this? It'd be great if we could have cofidence on this change.

It's hard to measure actual impact.

However Waker::clone is expensive, takio and async-task implementation require Atomic instructions. For example:
ArcWake require Arc::clone for each Waker::clone call.

timeout, join!, select! trigger repeated re-registration. and if they’re inside a loop. Multiple that for each iteration.

Waker instance very unlikely to change (In practice, I would say never).
That's a lot of unnecessary Atomic instructions.

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