Skip to main content

Performance Optimization

1. Choose the Right Processing Mode

Video Mode (VIDEO)
  • Suitable for real-time video streams and live streaming scenarios
  • Better performance and faster processing speed
  • Recommended for camera preview, video calls, and similar scenarios
Image Mode (IMAGE)
  • Suitable for single image processing
  • Higher quality and better effects
  • Recommended for photo editing and image beautification scenarios

2. Parameter Adjustment Recommendations

Beauty Parameter Adjustment Principles
  • Start with smaller values to avoid over-beautification
  • Recommend reducing parameter values in real-time scenarios for smooth performance
  • Static images can have appropriately higher parameter values
  • Adjust parameter ranges based on user groups and scenarios
Recommended Parameter Ranges

3. Memory Optimization

Use Direct Memory Buffers
Release Resources Timely

Architecture Design

1. Singleton Pattern for Engine Management

2. Asynchronous Image Processing

Error Handling

1. Comprehensive Error Handling Mechanism

2. Retry Mechanism

Lifecycle Management

The beauty engine requires manual release() to free resources. ImageFrame and other objects also need to call release() after use, otherwise it will cause memory leaks.

1. Activity Lifecycle Handling

2. Fragment Lifecycle Handling

Performance Monitoring

1. Performance Metrics Monitoring

2. Memory Usage Monitoring

Configuration Management

1. Beauty Configuration Management

Testing Recommendations

1. Unit Testing

2. Performance Testing