Uh oh!
There was an error while loading. Please reload this page.
Slightly optimise CString - #37622
Conversation
rust-highfive
commented
Nov 6, 2016
r? @brson (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Nov 7, 2016
Thanks for the PR! Are you worried about any particular function for |
alexcrichton
commented
Nov 7, 2016
Also, do you have benchmarks to back up the unsafe additions of eliding bounds checking? |
ollie27
commented
Nov 8, 2016
Not really, I just noticed that calling
I unfortunately haven't been able to see any difference from removing the bounds checks, only a possible tiny improvement from inlining. It probably doesn't matter much so I can remove it if you think it's too risky, I just noticed it in the assembly and thought we may as well remove some unnecessary instructions. |
alexcrichton
commented
Nov 8, 2016
We tend to avoid We also tend to prefer only using unsafe code for optimizations if we can show the improvement we're getting in perf, but if that's not the case here perhaps that could be backed out for now? |
Avoid a reallocation in CString::from and CStr::to_owned.
ollie27
commented
Nov 8, 2016
I've removed the inlining and bounds check removal. They weren't very important anyway. The use of |
alexcrichton
commented
Nov 8, 2016
@bors: r+ Yes |
bors
commented
Nov 8, 2016
📌 Commit 18f5f99 has been approved by |
Slightly optimise CString Avoid a reallocation in CString::from and CStr::to_owned.
Avoid a reallocation in CString::from and CStr::to_owned.