Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement cache monitoring system with performance metrics SR. NO. 11 #353

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

priyankeshh
Copy link
Contributor

Closes #351

Overview

This PR implements a comprehensive cache monitoring system to optimize image processing performance and memory management, particularly focusing on the adjust_brightness_contrast function.

Key Changes

Cache Monitoring Infrastructure

lazy_static! {
    static ref CACHE_HITS: AtomicUsize = AtomicUsize::new(0);
    static ref CACHE_MISSES: AtomicUsize = AtomicUsize::new(0);
    static ref CACHE_EVICTIONS: AtomicUsize = AtomicUsize::new(0);
    static ref TOTAL_PROCESSING_TIME: AtomicUsize = AtomicUsize::new(0);
}

New Cache Statistics API

  • Added CacheStats struct for comprehensive metrics
  • Implemented new Tauri commands:
    • get_cache_stats()
    • reset_cache_stats()
    • clear_image_cache()

Memory Management

  • Implemented configurable cache limits:
    • Max items: 100
    • Max memory: 1GB
    • Max image dimensions: 4096x4096
  • Added automatic cache eviction policy

Performance Metrics

The new monitoring system tracks:

  • Cache hit/miss rates
  • Memory usage patterns
  • Processing time per operation
  • Cache eviction frequency
  • Overall system performance

@Pranav0-0Aggarwal
Copy link
Member

Hey, there are merge conflicts
can you resolve them?

@priyankeshh
Copy link
Contributor Author

@Pranav0-0Aggarwal I resolved the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants