Repository navigation
Look through references for non-bool comparison operators - #510
Merged
Merged
Conversation
lucic71
marked this pull request as draft
October 9, 2026 17:49
Contributor
Author
|
This is not a very nice solution because it does more string surgeries on the trait implementation path. The reason we have to do so many string surgeries for Ord, PartialEq, Clone is that those traits receive a Getting rid of this situation means implementing our own Ord, ParitalEq, Clone. It's not very nice, but I think this will greatly improve the performance. Take Clone for example. Now is: impl Clone for T {
fn clone(&self) -> Self {
// Extra Rc/RefCell allocation + clone on every field
let __src: Value<T> = Rc::new(RefCell::new(T { a: self.a.clone(), ... }));
// all of this to be able to call a method on &Ptr<Self>
T::copy_from(__src.as_pointer())
}
}Faster version: impl OurClone for T {
fn clone(src: Ptr<Self>) -> Self {
T::copy_from(src)
}
} |
lucic71
marked this pull request as ready for review
October 9, 2026 21:46
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.
No description provided.