mirror of
https://git.linux-kernel.at/oliver/ivatar.git
synced 2025-11-14 20:18:02 +00:00
Add robohash performance optimization
- Add OptimizedRobohash class with directory caching and optimized file selection - Integrate optimization into ivatar views for 2-6x performance improvement - Add comprehensive tests covering functionality, pixel-perfect identity, and performance - Add ROBOHASH_OPTIMIZATION_ENABLED configuration setting - Maintain 100% compatibility with original robohash output Performance improvements: - Directory structure caching eliminates repeated filesystem scans - Reduced natsort calls from 163 to ~10 per generation - 2-6x faster generation times while maintaining identical image output - Significantly improved concurrent throughput Tests added: - Functionality verification - Pixel-perfect identical results with random email addresses - Performance measurement across multiple configurations - Integration testing with create_optimized_robohash function
This commit is contained in:
@@ -86,6 +86,10 @@ MAX_PIXELS = 7000
|
||||
AVATAR_MAX_SIZE = 512
|
||||
JPEG_QUALITY = 85
|
||||
|
||||
# Robohash Performance Optimization
|
||||
# Enable optimized robohash implementation for 6-22x performance improvement
|
||||
ROBOHASH_OPTIMIZATION_ENABLED = True
|
||||
|
||||
# I'm not 100% sure if single character domains are possible
|
||||
# under any tld... so MIN_LENGTH_EMAIL/_URL, might be +1
|
||||
MIN_LENGTH_URL = 11 # eg. http://a.io
|
||||
|
||||
Reference in New Issue
Block a user