- 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>
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>
- 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>
- 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>
- 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>