Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/tinystr/benches/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 902 B image not shown  

Quelle  read.rs   Sprache: unbekannt

 
Spracherkennung für: .rs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

// This file is part of ICU4X. For terms of use, please see the file
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

mod common;
use common::*;

use criterion::black_box;
use criterion::criterion_group;
use criterion::criterion_main;
use criterion::Bencher;
use criterion::Criterion;

use tinystr::TinyAsciiStr;

fn read(c: &mut Criterion) {
    macro_rules! cfs {
        ($r:ty, $inputs:expr) => {
            |b: &mut Bencher| {
                let parsed: Vec<$r> = $inputs.iter().map(|s| s.parse().unwrap()).collect();
                b.iter(|| {
                    for s in &parsed {
                        let _: &str = black_box(&**s);
                    }
                })
            }
        };
    }

    bench_block!(c, "read", cfs);
}

criterion_group!(benches, read,);
criterion_main!(benches);

[ Dauer der Verarbeitung: 0.34 Sekunden  ]