-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When comparing Field.t
values, avoid the conversion to bigint
#14597
Conversation
!ci-build-me |
a5dd0c4
to
3c6eb58
Compare
!ci-build-me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support this change: it strictly streamlines the code.
I ran a round of this fix with the ledger test-apply
tool and saw performance improvement of around 10%. It might be a statistical aberration though, but looks like even if there is a performance improvement, it;'s a marginal one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the original discussion please create a rust binding that explicitly calls into_repr
and use that instead.
From the comment on the rust function backing compare:
/// users should use this `Ord` for applications where
/// any ordering suffices (like in a BTreeMap), and not in applications
/// where a particular ordering is required.
@mrmr1993 to clarify, should |
@tizoc either is fine, whichever you prefer |
Ok, just updated the existing |
54bffd2
to
12a164f
Compare
efdf699
to
098f683
Compare
This one is included in #14599, leaving it open for now because this one is already approved and the other isn't, but they are related. |
12a164f
to
2d71655
Compare
This is included in #14599 which got merged already, closing. |
Explain your changes:
Field.compare
, perform the comparison in Rust instead of converting the values to bigints to compare them. More context hereExplain how you tested your changes:
*
Checklist: