Benchmark BM13xx protocol checksums
next-build / build (push) Canceled after 0s

This commit is contained in:
2026-10-16 14:06:25 -06:00
parent 853cb845ff
commit 98f3eb75c0
2 changed files with 20 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ EXPECTED_BENCHES = frozenset({
"stratum_configure_format", "stratum_subscribe_format",
"stratum_subscription_parse", "stratum_accept_parse",
"hal_socket_exchange", "stratum_socket_round_trip",
"bm13xx_crc5", "bm13xx_crc16",
})
BENCH_LINE = re.compile(r"\bBENCH ([A-Za-z0-9_]+) ([0-9]+(?:\.[0-9]+)?) ns/op\Z")
+19
View File
@@ -3,6 +3,7 @@ use alkane_os::bm1362::{
read_register_all, set_chip_address, write_register, write_register_all, Job, S19J_PRO,
};
use alkane_os::bm1366::{decode_nonce_report, encode_work};
use alkane_os::bm13xx::{crc16, crc5};
use alkane_os::difficulty::PoolDifficulty;
use alkane_os::hal_wire::HalClient;
use alkane_os::miner::Bm1366Miner;
@@ -72,6 +73,24 @@ fn bench_power_policy() {
});
}
#[test]
#[ignore = "microbenchmark"]
fn bench_bm13xx_crc5() {
let command = [0x53, 0x05, 0, 0];
measure("bm13xx_crc5", 100_000, || {
black_box(crc5(black_box(&command)));
});
}
#[test]
#[ignore = "microbenchmark"]
fn bench_bm13xx_crc16() {
let job = [0x21_u8; 84];
measure("bm13xx_crc16", 20_000, || {
black_box(crc16(black_box(&job)));
});
}
#[test]
#[ignore = "microbenchmark"]
fn bench_share_verification() {