Skip to content
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

Unsafe removal #1488

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Unsafe removal #1488

wants to merge 7 commits into from

Conversation

Wicpar
Copy link

@Wicpar Wicpar commented Nov 11, 2023

Removes unsafe implementations where in theory it should not affect perfoemance. I checked all implmenetations in compiler explorer, they give the equivalent code except for slice.fill() which is one zero check longer.

fastcmp is actually longer in assembly so i removed it as it contained unsafe too. the default cmp also calls the libc memcmp https://godbolt.org/z/83xTP74x1

Benchmarks are all over the place, so it's difficult to have a clear reading, it looks like a +-5% change in both ways with a slight bias for improvement.
If someone else can benchmark and corroborate my findings it would be great.

My benchmarks were done on a raid0 nvme windows machine.

Related to #1487

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.

1 participant