Skip to content

[Phase 4] Performance Benchmark Setup (Issue #41)#58

Merged
gmajor-encrypt merged 1 commit intomasterfrom
feature/performance-benchmark
Mar 25, 2026
Merged

[Phase 4] Performance Benchmark Setup (Issue #41)#58
gmajor-encrypt merged 1 commit intomasterfrom
feature/performance-benchmark

Conversation

@gmajor-encrypt
Copy link
Owner

Summary

This PR establishes a complete performance benchmark system using PHPBench.

Features Implemented

Benchmark Categories

IntegerBench

  • U8/U32/U64/U128 encoding/decoding
  • Round-trip tests

CompactBench

  • Small/Medium/Large/BigInt encoding
  • Compact decoding
  • Round-trip tests

CompoundBench

  • Vec, Vec encoding/decoding
  • Option encoding/decoding
  • Tuple encoding/decoding

SpecialBench

  • Bytes encoding/decoding
  • String encoding/decoding
  • AccountId encoding/decoding

MetadataBench

  • Metadata parsing (cached/uncached)

ExtrinsicBench

  • Extrinsic building
  • Extrinsic encoding/decoding

EventBench

  • Event parsing
  • Event indexing

PHPBench Configuration

  • Quick profile: 3 iterations, 10 revs
  • Standard profile: 10 iterations, 100 revs
  • Full profile: 20 iterations, 200 revs

Running Benchmarks

# Quick (development)
composer bench:quick

# Standard
composer bench

# Full (CI/release)
composer bench:full

Files Added

  • phpbench.json - PHPBench configuration
  • benchmark/IntegerBench.php
  • benchmark/CompactBench.php
  • benchmark/CompoundBench.php
  • benchmark/SpecialBench.php
  • benchmark/MetadataBench.php
  • benchmark/ExtrinsicBench.php
  • benchmark/EventBench.php
  • benchmark/README.md - Benchmark documentation

Updated Files

  • composer.json - Added PHPBench dependency and scripts
  • Makefile - Added benchmark targets

Issue


Ready for review.

- PHPBench framework configuration
- Integer encoding/decoding benchmarks
- Compact type benchmarks
- Compound type benchmarks (Vec, Option, Tuple)
- Special type benchmarks (Bytes, String, AccountId)
- Metadata parsing benchmarks
- Extrinsic encoding/decoding benchmarks
- Event parsing benchmarks

Features:
- Quick/standard/full benchmark profiles
- Performance report generation
- Comprehensive benchmark documentation

Closes #41
@gmajor-encrypt gmajor-encrypt merged commit ad718d0 into master Mar 25, 2026
1 check passed
@gmajor-encrypt gmajor-encrypt deleted the feature/performance-benchmark branch March 25, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 4] Performance Benchmark Setup

1 participant