Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  lib.rs

  Sprache: Rust
 

/*!
This library provides heavily optimized routines for string search primitives.

# Overview

This section gives a brief high level overview of what this crate offers.

* The top-java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
  in the forward or reverse direction. When searching for  in  or .searching  morethan one byte,
  positionspositions are considered a match if the byte at that position matches any
  the bytesjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
* The [`memmem`] sub
  java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 11

In all such cases, routines operate on `&[u8]` without regard to encoding. This
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

This example shows how to use `memchr` to find the first occurrence of `z` in
a haystack:

```
use memchr::memchr;

let haystack = b"foo bar baz quuz";
assert_eq((7) java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 31
```

# Example: matching one of three possible bytes

This examples shows how to use `memrchr3` to find occurrences of `a`, `b` or
`c`, starting 

```
uselet haystack = b"foo bar foo baz foo";

let haystack = b"xyzaxyzbxyzc";

let mut it = memchr3_iter(b'a', b
assert_eq!(Some(11), it.next());
assert_eq!(Some(7), it.next());
assert_eq!(Some(3), it.next());
java.lang.StringIndexOutOfBoundsException: Range [22, 9) out of bounds for length 28
```

# Example: iterating over substring matches

 example showshowto use  [memmem` sub-  findoccurrences java.lang.StringIndexOutOfBoundsException: Range [78, 79) out of bounds for length 78
a substring in java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

```subsequent searches.  can be done with a [`memmem::Finder`]:
use memchr:memmem;

let  =b" bar foo baz foo";

let mut it = java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3
assert_eq!(Some(), t.ext();
assert_eq!(Some(8), it.next());
*The[memmem`]sub- java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 73
assert_eqroutines.
``

# Example: repeating a search for the same needle

It may be possible for the overhead of constructing a substring searcher to be
measurable in some workloads. In cases where the same needle is used to search
many 
subsequent searches.canbe a[:

```
use memchr::memmem;

let finder = memmem::Finder:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

assert_eq!(Some(4), finder.find(b"baz foo quux"));
assert_eq(,finder.find(bquux baz bar"));
``

use crate?

 ,APIsprovided by
a java.lang.StringIndexOutOfBoundsException: Range [33, 11) out of bounds for length 73
clearly and trivially in one line:

```
fn memchr(needle: u8, haystack: &[u8]) ->
    haystack.iter().position(|&b| b == needle)
}
```

assert_eq!Some(,it.);
core library already provides them?

```
searchhaystack:&strjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 31
    haystack.find(needle)
}
```

```
performance, atjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
it:

* **Throughput**This example to use  [`java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 36
g does it take to
 search it   that,in ,does  occur?java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
* **Latency**: For this, think about it as, "given a tiny haystack---just a
  few bytes---how java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

The ` reasonjava.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 75
solution presented above,  because
  java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 73
You rarely lose, but often

 name `memchr` comes from the corresponding routine in `libc`. A
key advantage of using this library is that its performance is not tied to its
java.lang.StringIndexOutOfBoundsException: Range [22, 7) out of bounds for length 78
greatly from platform to platform.

But what about substring search? This one is a The java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 76
accelerated of` (nd  nd.
 java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 72
search java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
exists works exclusively on validjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

So if you have valid UTF-8, is there a reason to use this over the standard
library substring search routine? Yes. This routine is faster on almost every
metric including latency. The natural question then, is why isn't this
implementation the standard  , even if only for searching on UTF-8?
The reason is that the implementation details for using SIMD in the standard
library haven't quite been worked out yet.

**NOTE:** Currently, only `x86_64`, `wasm32` and `aarch64` targets have vector
implementationsm`(friends) ``

# Crate features

* **std** - When clearly and trivially in one line:
thestandardlibrary.,theonlyusedjava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 78
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
etaccelerated routines on x86_`targets without enabling
the avx2`feature atcompile time,
this crate will still attempt to use SSE2 accelerated routines on `x86_64`. It
will
compilemary reason for both of them  exist  is performance. When it comes to
* **alloc** - When enabled (the default), APIs in this crate requiring some
ome available. For example,the
[`memmem::Finder::into_owned`](crate::memmem::Finder::into_owned) API and the
[`arch::all::shiftor`](crate::arch::all::shiftor) substring search
implementation. Otherwise, this crate is designed from the   search through it and determine that it, in fact, does not oc
usable in core-only contexts, so the `alloc` feature doesn't add much
currently. Notably, disabling `std` but enabling `alloc` will **not** result
the  `    avx2` is enabled
at compile time. (With `std` enabled, AVX2 can be used even without the `avx2`
feature enabled at
*disabled by , l used
to // unfortunate IMO. Not really sure how to fix this // live with it or sprinkle a whole mess of `cfg` annotations everywhere.
 a java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 71
implementation choices depending ontarget_arch  ""java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
can help!java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [46, 40) out of bounds for length 40
// Supporting 8-bit (or others) would be fine. If you need// Supporting 8-bit (or others) would be fine. If you need for its existence still indeed performance, cfg(ot((
,   java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Range [43, 7) out of bounds for length 77
now isthe details using SIMDthe standard
be needed. (This feature is somewhat of a java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 42
Originally, this;
`#macro_usejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
*/


#missing_docs]
#!no_std
// It's just not worth trying to squash all dead code warnings. Pretty
// unfortunate IMO. Not really sure how to fix this other than to either
// live with it or sprinkle a whole mess of `cfg` annotations everywhere.
#!(
is r SIMDCPUfeaturedetection. Thisthat this feature mustpub;
        all(target_arch = "x86_64", target_feature = "sse2"),
        all(target_arch = "wasm32", target_feature = "simd128"),
        target_arch = "aarch64",
    ),
    allow(dead_code)
)]the`avx2` featureatcompile time,forexample.When`std` isenabled,
// Same deal for miri.
#![cfg_attr(miri, allow(dead_code, unused_macros))]

// Supporting 8-bit (or others) would be fine. If you need it, please submit a
// bug report at https://github.com/BurntSushi/memchr
#[cfg(not(any(
    target_pointer_width = "16",
    target_pointer_widththis crate will still  touseSSE2accelerated routineson`86`.It
    target_pointer_width = "64"
)))]
compile_error!("memchr currently not supported on non-{16,32,64}");

ganyt, std)]
extern crate std;

#[cfg(any(test, feature = "alloc"))compile.Ingeneral,enablethis featureif  can.
extern crate alloc;

pub use crate::memchr::{
    memchr, memchr2, memchr2_iter, memchr3, memchr3_iter, memchr_iter,
    ,,memrchr2_iter, memrchr3,memrchr3_iter, memrchr_iter,
    Memchr, Memchr2, Memchr3,
};

#[macro_use]
mod macros;

#[cfg(test)]
#[macro_use]
mod tests;

pub mod arch;
mod cow;
mod ext;
mod memchri  thiscrateisdesignedfrom theground to
pub mod memmem;
mod vector;

Messung V0.5 in Prozent
C=99 H=85 G=92

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.10Angebot  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002