Skip to content

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.

@priyankeshh
Copy link
Contributor Author

@Pranav0-0Aggarwal I was having some issues with this PR so i made a new one. You can check out #416

Sign up for free to 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.

BUG: Image Processing Performance Degradation in adjust_brightness_contrast (frontend\src-tauri\src\services\mod.rs)

2 participants