<commit_before>#[macro_use]
extern crate criterion;
extern crate bmemcached;

use criterion::Criterion;

use bmemcached::MemcachedClient;

fn criterion_benchmark(c: &mut Criterion) {
    let cli = MemcachedClient::new(vec!["127.0.0.1:11211"], 10).unwrap();
    c.bench_function("set/get/delete", move |b| {
        b.iter(|| {
            let key = "benchmark test";
            cli.set(key, "abc", 10_000).unwrap();
            let returned_value: String = cli.get(key).unwrap();
            assert_eq!(returned_value, "abc");
            cli.delete(key).unwrap();
        })
    });
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);
<commit_msg>chore: Change regression benchmark to use protocol directly<commit_after>#[macro_use]
extern crate criterion;
extern crate bmemcached;

use criterion::Criterion;

use bmemcached::protocol::Protocol;

fn criterion_benchmark(c: &mut Criterion) {
    c.bench_function("set/get/delete", |b| {
        let mut cli = Protocol::connect("127.0.0.1:11211").unwrap();
        b.iter(|| {
            let key = "benchmark test";
            cli.set(key, "abc", 10_000).unwrap();
            let returned_value: String = cli.get(key).unwrap();
            assert_eq!(returned_value, "abc");
            cli.delete(key).unwrap();
        })
    });
}

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

{'fraction_non_alphanumeric': 0.1521268925739005, 'fraction_numerical': 0.024513338139870222, 'mean_word_length': 3.32398753894081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7209157', 'n_tokens_mistral': 487, 'n_tokens_neox': 450, 'n_words': 86}