Skip to content

Conversation

@vilsonrodrigues
Copy link
Contributor

Summary

Significantly improves the benchmark suite to ensure accurate and reproducible performance claims:

  • Statistical analysis: 10 runs with mean, median, std dev, min, max
  • Fair comparison: Both libraries test equivalent configuration complexity
  • Honest results: Updated README from 3.8x to 2.7x faster (based on actual measurements)
  • Better organization: Moved benchmark files to dedicated /benchmark directory
  • Easy reproduction: New ./benchmark/run_benchmark.sh script using uvx

Changes

Benchmark Improvements

  • Test realistic configuration with 18 fields (app, database, redis, feature flags)
  • msgspec-ext: Flat structure optimized for .env parsing
  • pydantic-settings: Nested structure with BaseSettings classes
  • Both load from identical .env file for fair comparison
  • System information display (Python version, platform, library versions)
  • Raw timing data output for verification

README Updates

  • Updated performance claim: 2.7x faster (down from 3.8x)
  • Based on 10 runs × 1000 iterations with statistical validation
  • More detailed benchmark description
  • Updated reproduction instructions

File Organization

benchmark/
├── benchmark.py           # Comprehensive benchmark with stats
└── run_benchmark.sh       # Easy execution script (uses uvx)

Benchmark Results

Current (10 runs × 1000 iterations, Python 3.12):

Library Time per load Relative Performance
msgspec-ext 2.271ms Baseline ⚡
pydantic-settings 6.157ms 2.7x slower

More honest, reproducible, and statistically sound results.

Test Plan

  • Run benchmark multiple times to verify stability
  • Verify both libraries load identical configuration
  • Update all performance claims in README
  • Test reproduction script (./benchmark/run_benchmark.sh)

🤖 Generated with Claude Code

vilsonrodrigues and others added 7 commits November 27, 2025 02:18
- Complete project structure overview
- Common commands and workflows
- Release process (always use ./scripts/release.sh)
- Architecture details and optimizations
- Linting, testing, and CI/CD guides
- Troubleshooting tips

This file provides context for Claude Code to work more effectively
with the project without repeating instructions.
- Use generic sans-serif font for better cross-platform compatibility
- Add preserveAspectRatio for proper scaling across devices
- Adjust viewBox and text positioning for better layout
- Update README description: msgspec is a validation and serialization library

The logo now uses a simple sans font with proper responsive attributes,
ensuring consistent and readable rendering on all devices and screen sizes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Unified text in one line: "msgspec-ext"
- Use golden color (#a67c00) for all text
- Remove line break for simpler layout

Note: Text rendering still varies across devices. Consider using PNG
or icon-only approach for truly consistent rendering.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Move assets/ to docs/assets/ for better organization
- Generate high-quality PNG logos (600 DPI) using Inkscape
- Update README to reference PNG logos in new location
- Update README description: msgspec is a validation and serialization library

PNG logos ensure pixel-perfect identical rendering across all browsers,
operating systems, and devices, eliminating font-dependent variations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The update command was failing because the checkout action wasn't
specifying which repository to checkout from. This caused it to only
fetch the default branches and not the PR branch.

Added 'repository' parameter to the checkout action to explicitly
specify the head repository, fixing the branch checkout issue.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vilsonrodrigues vilsonrodrigues force-pushed the fix/improve-benchmark branch 2 times, most recently from 88b5c5f to 41293e2 Compare November 27, 2025 21:40
@vilsonrodrigues
Copy link
Contributor Author

/update

@github-actions
Copy link

✅ Branch updated successfully by @vilsonrodrigues!

Merged latest changes from main.

Changes:
- Move benchmark files to dedicated /benchmark directory
- Add run_benchmark.sh script for easy execution with uvx
- Improve benchmark.py with:
  - Statistical analysis: 10 runs with mean, median, std dev, min, max
  - Fair comparison: Both libraries test equivalent configuration complexity
  - System information: Display Python version, platform, library versions
  - Better warmup: 50 iterations before timing
  - Raw data output: All timing data for verification
  - Comprehensive documentation

Benchmark improvements:
- Test realistic configuration with 18 fields across multiple categories
- msgspec-ext: Flat structure with __ delimiter (optimized for .env)
- pydantic-settings: Nested structure with BaseSettings classes
- Both load from identical .env file

Updated README with accurate benchmark results:
- 2.7x faster than pydantic-settings (down from 3.8x claim)
- Based on 10 runs × 1000 iterations with statistical validation
- More honest and reproducible results

Run: ./benchmark/run_benchmark.sh to reproduce results

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@vilsonrodrigues
Copy link
Contributor Author

/merge

@github-actions github-actions bot merged commit b7b3173 into msgflux:main Nov 27, 2025
7 checks passed
@github-actions
Copy link

✅ PR merged successfully by @vilsonrodrigues!

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.

1 participant