-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Optimized hash lookups #4144
Optimized hash lookups #4144
Conversation
@@ -62,6 +62,8 @@ pub fn clean_0x(s: &str) -> &str { | |||
} | |||
} | |||
|
|||
extern { fn memcmp(s1: *const i8, s2: *const i8, n: usize) -> i32; } |
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.
should use the libc typedefs rather than Rust native types.
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.
and actually, since the libc dependency is necessary to do this correctly, we should just use https://doc.rust-lang.org/libc/x86_64-unknown-linux-gnu/libc/fn.memcmp.html
rather than linking it in ad-hoc
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.
memcmp
is intrinsic and does not actually require libc. I'd prefer not to add a dependency that is not really needed.
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.
it is needed if we want this code to be future-proof/cross-platform
* Optimize hash comparison * Use libc
* verification: check if server is running (#4140) * verification: check if server is running See also ethcore/email-verification#67c6466 and ethcore/sms-verification#a585e42. * verification: show in the UI if server is running * verification: code style ✨, more i18n * fix i18n key * Optimized hash lookups (#4144) * Optimize hash comparison * Use libc * Ropsten fork detection (#4163) * Stop flickering + added loader in AddressSelector (#4149) * Stop UI flickering + added loader to AddressSelector #4103 * PR Grumbles * Add a password strength component (#4153) * Added new PasswordStrength Component * Added tests * PR Grumbles * icarus -> update, increase web timeout. (#4165) * icarus -> update, increase web timeout. * Fix estimate gas * Fix token images // Error in Contract Queries (#4169) * Fix dapps not loading (#4170) * Add secure to dappsreg * Remove trailing slash // fix dapps
Profiling shows that
eq
is not compiled into the most efficient code and is on a hot path.