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

remove unsafe code in IoReader #309

Merged
merged 2 commits into from Mar 20, 2020
Merged

remove unsafe code in IoReader #309

merged 2 commits into from Mar 20, 2020

Conversation

@ZoeyR
Copy link
Collaborator

ZoeyR commented Mar 15, 2020

Fully fixes #260

I ran benchmarks with https://github.com/erickt/rust-serialization-benchmarks and couldn't find any appreciable difference in the time it took to execute. If anything, the new method runs faster.

ZoeyR added 2 commits Mar 15, 2020
Copy link
Contributor

strega-nil left a comment

Could you upload some graphs of the benchmarks? Otherwise, this is a great change imo!

@ZoeyR
Copy link
Collaborator Author

ZoeyR commented Mar 18, 2020

I tested on a different machine and got different results for which implementation came in first.
image

So based on the machine it might end up being slightly slower. I think the trade-off is still worth it to avoid undefined behaviour, especially in a serialization library that might interface with remote machines. Once rust resolves rust-lang/rust#42788 we can evaluate changing the implementation.

@ZoeyR ZoeyR merged commit 11eeaf2 into servo:master Mar 20, 2020
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.