Comments (2)
Sorry, I don't quite understand the request here. I would say there are a few dimensions to it:
- Do you have a real benchmark where eliding the check improves things? If so, I'd love to see it, because it is somewhat surprising to me that it would help much. In particular,
memchr
is always going to result in at least a pointer load and a function call, so a single branch in addition to that probably isn't adding much overhead. - More importantly, it's unclear to me why you have this conditional at all. Why not just elide
if i >= s.len() {
completely? Maybe what you're saying---without actually saying it---is that the conditional provides a way for other code to avoid bounds checks. If so, then I'd really appreciate more detail, particularly with respect to (1). - How would you go about moving the hint to the inside this crate?
from memchr.
Closing due to inactivity and the next steps here are unclear to me.
from memchr.
Related Issues (20)
- Use of `AtomicPtr` in `unsafe_ifunc` prevents memchr from being inlined when compiled with avx enabled HOT 4
- Error building for arm64 on a am64 with docker HOT 2
- Provide const implementation HOT 4
- Poor performance on Zen 1/Threadripper due to loop unrolling HOT 4
- Build script flagged as Virus by Kaspersky Endpoint Security HOT 1
- memchr 2.5.0 fails to compile on Android HOT 3
- Runtime configuration of byte frequency table used to classify rare bytes HOT 10
- Feature request: no-std + alloc HOT 3
- no-std + cpu feature detection? HOT 5
- failed to compile `memchr 2.5.0` on macos-12 and macos-11 HOT 2
- `Memchr<'_>` is no longer `Sync` from v2.6 HOT 2
- consider semver-checks HOT 8
- New SIMD improvements break MSRV for aarch64 targets HOT 2
- Update Cargo.toml `package.description` HOT 1
- `x86` performance regression `2.5.0` -> `2.6.0` HOT 16
- The force-enabling of SIMD128 feature can lead to unloadable WASMs in some browsers HOT 9
- Cannot compile with thin-lto on MinGW HOT 1
- Alternate API ordering suggestion HOT 2
- `memchr4` HOT 1
- add documentation for internal code structure and organization HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memchr.