MCPcopy Create free account
hub / github.com/evilsocket/cake / batch_encode

Function batch_encode

cake-core/benches/bench_protocol.rs:31–42  ·  view source on GitHub ↗
(bencher: divan::Bencher)

Source from the content-addressed store, hash-verified

29
30#[divan::bench]
31fn batch_encode(bencher: divan::Bencher) {
32 let t = make_f16_tensor(4096);
33 let batch = vec![
34 ("model.layers.0".into(), 0usize, 0usize),
35 ("model.layers.1".into(), 1, 1),
36 ("model.layers.2".into(), 2, 2),
37 ];
38 let msg = Message::from_batch(&t, batch);
39 bencher
40 .counter(divan::counter::BytesCount::new(4096usize * 2))
41 .bench_local(|| msg.to_bytes().unwrap());
42}
43
44#[divan::bench]
45fn batch_decode(bencher: divan::Bencher) {

Callers

nothing calls this directly

Calls 2

to_bytesMethod · 0.80
make_f16_tensorFunction · 0.70

Tested by

no test coverage detected