Skip to content

Benchmark files contain only placeholder implementations #55

@qj0r9j0vc2

Description

@qj0r9j0vc2

Summary

Multiple benchmark files exist but contain only placeholder implementations with no actual benchmarking logic.

Problem Locations

crates/crypto/benches/bls_bench.rs

fn bench_bls_sign(_c: &mut Criterion) {
    // Placeholder
}

fn bench_bls_verify(_c: &mut Criterion) {
    // Placeholder
}

fn bench_bls_aggregate(_c: &mut Criterion) {
    // Placeholder
}

crates/data-chain/benches/attestation_bench.rs

fn bench_attestation_aggregation(_c: &mut Criterion) {
    // Placeholder - will implement after core types work
}

fn bench_attestation_verification(_c: &mut Criterion) {
    // Placeholder
}

crates/data-chain/benches/car_bench.rs

fn bench_car_creation(_c: &mut Criterion) {
    // Placeholder - will implement after core types work
}

fn bench_car_signing_bytes(_c: &mut Criterion) {
    // Placeholder
}

Impact

  • No Performance Baseline: Cannot track performance regressions
  • Misleading CI: Benchmark targets exist but provide no value
  • Hidden Issues: Performance-critical paths (BLS operations, attestation) are unbenchmarked

Recommended Fix

Implement actual benchmarks for critical paths:

fn bench_bls_sign(c: &mut Criterion) {
    let sk = SecretKey::random(&mut rand::thread_rng());
    let msg = b"test message";
    
    c.bench_function("bls_sign", |b| {
        b.iter(|| sk.sign(black_box(msg)))
    });
}

fn bench_bls_verify(c: &mut Criterion) {
    let sk = SecretKey::random(&mut rand::thread_rng());
    let pk = sk.public_key();
    let msg = b"test message";
    let sig = sk.sign(msg);
    
    c.bench_function("bls_verify", |b| {
        b.iter(|| sig.verify(black_box(&pk), black_box(msg)))
    });
}

fn bench_bls_aggregate(c: &mut Criterion) {
    let sigs: Vec<_> = (0..100)
        .map(|_| SecretKey::random(&mut rand::thread_rng()).sign(b"msg"))
        .collect();
    
    c.bench_function("bls_aggregate_100", |b| {
        b.iter(|| Signature::aggregate(black_box(&sigs)))
    });
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions