Commit graph

7 commits

Author SHA1 Message Date
semihalev
f1add2d820 Implement efficient LRU eviction strategy for attribute cache
- Added tracking of last access time and access count to cache entries
- Implemented eviction policy to remove least recently/frequently used entries
- Cache now removes 10% of entries when the cache is full, prioritizing by usage
- Added benchmarks and tests to verify eviction strategy
- Fixed the previously ineffective eviction strategy
- Improved cache efficiency for applications with many diverse object types

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 14:20:47 +03:00
semihalev
783d8a9d5f Optimize compiled template serialization
This commit improves the template serialization format by:

1. Replacing gob encoding with binary encoding for CompiledTemplate
   - Reduces serialized data size by ~55%
   - Improves serialization/deserialization speed by ~22x
   - Adds fallback path for backward compatibility

2. Adding buffer pooling to reduce allocations
   - Reuses buffers during serialization
   - Minimizes garbage collection pressure

3. Adding version marker to serialized data
   - Enables future format changes with backward compatibility
   - Provides clean upgrade path

4. Adding Size() method to report compiled template size
   - Helps with monitoring memory usage

This optimization significantly reduces both memory usage and CPU
overhead when using compiled templates.

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 13:57:04 +03:00
semihalev
cce67f94c9 Fix code style inconsistencies and update documentation
- Update documentation with negative step range workaround
- Document limitations and solutions in FINDINGS.md and SOLUTION.md
- Clean up code style and remove experimental files
- Optimize performance in core functions
- Fix whitespace and end-of-file newlines

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-11 09:29:12 +03:00
semihalev
b9b0058c26 Enhance README with badges and comprehensive documentation
- Add status badges (Go Report Card, GoDoc, License, Release)
- Create a Table of Contents for better navigation
- Add Examples section with code samples from the repository
- Add new sections:
  - Installation Requirements
  - Running Tests
  - Compatibility with Twig PHP
  - Versioning Policy
  - Security Considerations
  - Contributing Guidelines
  - Roadmap
  - Community & Support

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 10:42:58 +03:00
semihalev
ecf7d709ad Improved error handling and added debugging tools
- Added enhanced error reporting with source context
- Implemented debug logging system with multiple verbosity levels
- Added memory pooling for render contexts and string buffers
- Implemented better error messages with template name and line information
- Fixed concurrency issues in template loading
- Added improved attribute reflection caching
- Created comprehensive tests for all new features
- Updated documentation with debugging examples

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 09:41:01 +03:00
semihalev
52693a0b4a Performance and stability improvements
- Fixed concurrency safety issues in template cache and loaders
- Implemented attribute access caching to reduce reflection usage
- Added memory pooling for render contexts and string buffers
- Improved error handling for more resilient template loading
- Added detailed benchmarks showing performance improvements
- Updated documentation with progress and improvements

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 09:33:05 +03:00
semihalev
f9b283c393 Add template compilation capabilities
- Implement a compiled template format using gob encoding
- Add methods to compile templates and load from compiled templates
- Create dedicated CompiledLoader for managing compiled templates
- Enable auto-reload support for compiled templates
- Add comprehensive tests including benchmarks
- Create example application for template compilation workflow
- Update documentation with compilation features and examples

🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-10 09:21:20 +03:00