ParaloomPARALOOM

Performance

Performance characteristics and benchmarks

Performance

This document covers Paraloom's performance characteristics and optimization strategies.

Key Metrics

Privacy Layer

OperationTimeNotes
Proof Generation2-3sUser-side, parallelizable
Proof Verification~10msValidator-side
Poseidon HashUnder 1msPer hash operation

Consensus

MetricValue
Consensus LatencyUnder 1s
Verification BroadcastUnder 100ms
Vote CollectionUnder 500ms

Compute Layer

Job TypeTypical Time
Simple WASMUnder 1s
ZK Proof Generation2-5s
ML Inference5-30s

Network

MetricValue
P2P Message LatencyUnder 100ms (local)
Bridge Polling10s intervals
Heartbeat30s intervals

Benchmarks

Proof Generation

Benchmark: generate_withdrawal_proof
  Iterations: 100
  Mean: 2.34s
  Std Dev: 0.21s
  Min: 1.98s
  Max: 3.12s

Hardware: AMD Ryzen 9 5900X, 32GB RAM

Proof Verification

Benchmark: verify_groth16_proof
  Iterations: 10000
  Mean: 9.8ms
  Std Dev: 0.4ms
  Min: 8.9ms
  Max: 12.1ms

Hardware: AMD Ryzen 9 5900X, 32GB RAM

Poseidon Hash

Benchmark: poseidon_hash_pair
  Iterations: 1000000
  Mean: 0.12ms
  Throughput: ~8300 hashes/sec

Hardware: AMD Ryzen 9 5900X, 32GB RAM

WASM Execution

Benchmark: wasm_simple_compute
  Iterations: 1000
  Mean: 0.8ms
  Memory: 1.2MB peak

Benchmark: wasm_complex_compute (1MB input)
  Iterations: 100
  Mean: 45ms
  Memory: 12MB peak

Hardware: AMD Ryzen 9 5900X, 32GB RAM

Throughput

Current Limits

OperationThroughput
Deposits~100/sec (Solana limited)
Withdrawals~1/sec (consensus limited)
Compute Jobs~10/sec (per validator)
P2P Messages~1000/sec

Bottlenecks

  1. Consensus Round Time

    • 7/10 validators must respond
    • Network latency adds up
  2. Proof Generation

    • CPU-intensive
    • Single-threaded by default
  3. Solana Block Time

    • ~400ms per slot
    • Transaction confirmation

Optimization Strategies

Proof Generation

Parallel Proving:

use rayon::prelude::*;

// Generate multiple proofs in parallel
let proofs: Vec<Proof> = inputs
    .par_iter()
    .map(|input| generate_proof(input))
    .collect();

Key Caching:

lazy_static! {
    static ref PROVING_KEY: ProvingKey = load_proving_key();
    static ref VERIFYING_KEY: VerifyingKey = load_verifying_key();
}

Consensus

Parallel Verification:

// Validators verify in parallel
let results: Vec<bool> = proofs
    .par_iter()
    .map(|proof| verify_proof(proof))
    .collect();

Batch Processing:

// Batch multiple verifications
let batch_result = verify_batch(&proofs, &public_inputs);

Compute Layer

Memory Optimization:

// Use streaming for large inputs
let result = engine.execute_streaming(
    wasm_code,
    input_stream,
    64 * 1024 * 1024, // 64MB limit
)?;

Job Prioritization:

// Prioritize smaller jobs
job_queue.sort_by_key(|job| job.estimated_time);

Network

Connection Pooling:

// Reuse connections
let pool = ConnectionPool::new(max_connections: 50);
let conn = pool.get_connection(peer_id)?;

Message Batching:

// Batch small messages
let batch = messages
    .chunks(100)
    .map(|chunk| create_batch(chunk))
    .collect();

Resource Usage

Memory

ComponentTypical Usage
Validator Node500MB - 1GB
Proof Generation100-200MB
WASM Execution64MB limit
Network Stack50-100MB

CPU

OperationCPU Usage
Proof Generation100% (single core)
Proof Verification10-20%
WASM Execution50-100%
Idle1-5%

Disk

DataSize
Merkle Tree~100 bytes/commitment
Nullifier Set~40 bytes/nullifier
Proving Key~1.5 MB
Verifying Key~600 bytes

Network

TrafficBandwidth
IdleUnder 1 KB/s
Active Verification~10 KB/s
Compute Job~100 KB/s
Peak~1 MB/s

Scaling Considerations

Horizontal Scaling

  • Add more validators for consensus throughput
  • Distribute compute jobs across validators
  • Use CDN for static assets (proofs, keys)

Vertical Scaling

  • Faster CPU for proof generation
  • More RAM for larger WASM jobs
  • NVMe SSD for storage operations

Future Optimizations

  1. Batch Proof Verification

    • Aggregate multiple proofs
    • Single verification for batch
  2. Recursive Proofs

    • Prove verification of proofs
    • Constant-size proofs
  3. Hardware Acceleration

    • GPU proof generation
    • FPGA verification
  4. Layer 2 Aggregation

    • Bundle transactions
    • Single proof for bundle

Monitoring Performance

Metrics to Track

// Key metrics
paraloom_proof_generation_seconds
paraloom_proof_verification_seconds
paraloom_consensus_rounds_total
paraloom_consensus_latency_seconds
paraloom_compute_jobs_total
paraloom_compute_duration_seconds
paraloom_network_messages_total
paraloom_network_latency_seconds

Alerting Thresholds

MetricWarningCritical
Proof Generation>5s>10s
Consensus Latency>2s>5s
Job Queue Length>100>500
Memory Usage>80%>95%

On this page