-
Notifications
You must be signed in to change notification settings - Fork 228
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
perf: skip molecule checking in release build #2579
Conversation
benchmark, sync-test |
Benchmark Result
|
Sync Test Result
|
benchmark, sync-test |
Benchmark Result
|
sync-test |
Sync Test Result
|
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'm against this PR. The function name suggests that it will panic on invalid data, it is surprising that it does not. It is very easy to be abused.
If we really want to skip the verification only in release mode, we should add a new function to do that.
how about change the name to |
sync-test |
Sync Test Result
|
What's the reason that we cannot use |
First, just an additional explanation: Do no checks means we can make sure that:
The worst situation I imagined is: no panics caused at beginning, but only malformed data, then we found the bug several days later. Speaking of this, I remembered that in Matt Damon's film "The Martian", their rocket exploded because the NASA skip few checks which only have very very very small probability to find bugs. Second, there no strong evidences could approve that those checks cost too many resource, so that we have to remove them. p.s. I'm not opposed to this optimization, but also I don't want to approve it. And, the changes are right, no issue for codes. |
Can one of the admins verify this patch? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Close since it does not gains enough approvals. |
we should view the the slice as infallible, trusted entity in release build, skip length and bounds check.