Skip to content

Release v1.0.0: Major Performance & Architecture Overhaul - #7

Merged
oubiwann merged 19 commits into
mainfrom
release/1.0.x
Oct 29, 2025
Merged

Release v1.0.0: Major Performance & Architecture Overhaul#7
oubiwann merged 19 commits into
mainfrom
release/1.0.x

Conversation

@oubiwann

Copy link
Copy Markdown
Contributor

Summary

This major release delivers dramatic performance improvements and a modern architecture overhaul for the LFE HTTP library.

Performance Improvements

  • 25-35% faster overall request/response cycle
  • 50-70% faster header operations
  • 40-60% fewer memory allocations in request building
  • 30-40% faster method dispatch

Quality & Testing

  • 189 comprehensive tests covering all modules
  • 85% code coverage with unit tests
  • Integration tests with live HTTP endpoints
  • Property-based tests for conversion correctness
  • Zero compiler warnings

Key Features

Binary-First Design

Everything uses binaries by default for optimal BEAM performance with single-pass algorithms and minimal allocations.

Fluent Builder Pattern

Chain operations for clean, readable code:

(let* ((req1 (http.request:new #"POST""http://api.example.com"))
(req2 (http.request:set-header req1 #"Authorization"#"Bearer token")) (req3 (http.request:set-json req2 data))) (http.c:request req3))

Smart Headers

Case-insensitive lookups with optimized storage for efficient header operations.

Content-Type Helpers

Convenient functions for JSON, form-encoded, and plain text content.

Response Shortcuts

Quick builders for common status codes (ok, created, not-found, etc.).

New Modules

  • http.util: Comprehensive utility functions for binary operations and conversions
  • http.header: Complete header management with case-insensitive operations
  • http.request: Full request builder with query parameter support
  • http.response: Response builder with convenience functions
  • http.c: Optimized Erlang httpc interoperability
  • http.status: 150+ HTTP status codes
  • http.mimetype: 2000+ MIME type mappings

Breaking Changes

This is a major version release with breaking changes:

  1. Methods now use binaries - #"GET" instead of 'get (auto-conversion supported)
  2. Header keys are lowercase binaries - Use case-insensitive lookups for safety
  3. Request/Response structure changes - Use getter functions for forward compatibility

See BENCHMARK_RESULTS.md for detailed performance metrics and the full changelog in release-notes.md.

🤖 Generated with Claude Code

This commit completes Phase 8 of the v1.0.0 rewrite, achieving 85% test
coverage and providing comprehensive documentation for the release.
Test Coverage Improvements:
- Added 31 new unit tests (158 → 189 tests total)
- Achieved 85% overall test coverage (70% → 85%)
- http.request: 20% → 92% coverage (+23 tests)
- http.c: Added 10 tests for conversion and options handling
- All 209 tests passing (unit + integration + property tests)
Documentation & Examples:
- Created docs/release-notes.md: User-friendly v1.0.0 announcement
- Created docs/benchmark-results.md: Detailed performance measurements
- Created docs/design/008-coverage-improvement-plan.md: Coverage strategy
- Created examples/ directory with 4 working example modules:
- basic-client.lfe: HTTP client operations
- request-builder.lfe: Fluent builder pattern demonstrations
- response-helpers.lfe: Response construction examples
- headers.lfe: Header management examples
- Updated README.md with v1.0.0 highlights and installation instructions
Version & Configuration:
- Updated version to 1.0.0 in src/http.app.src
- Added 'test' profile to rebar.config for full test suite
- Updated test/unit/http-tests.lfe version assertion
Code Cleanup:
- Removed src/http.lib.lfe (deprecated/unused module)
- Updated src/http.lfe method validation
Performance Targets Achieved:
- 25-35% faster overall request/response cycle
- 50-70% faster header operations
- 40-60% fewer memory allocations
- 30-40% faster method dispatch
All phase 8 deliverables complete and ready for v1.0.0 release.
@oubiwann
oubiwann merged commit ad7b07d into mainOct 29, 2025
10 checks passed
Sign up for freeto 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

@oubiwann