Artillex-Studios / AxRewards

A lightweight daily / weekly reward plugin.
MIT License
3 stars 2 forks source link

Performance Enhancements in MySQL Database Management #4

Open ReferTV opened 1 month ago

ReferTV commented 1 month ago

Performance Improvements from Code Changes

  1. Better Connection Handling:

    • Enhanced error handling in the getConnection() method helps quickly identify connection issues, reducing downtime and improving reliability.
  2. Default Values:

    • Using sensible default values for connection pool settings prevents misconfigurations, ensuring smooth operation even if specific settings are missing.
  3. Updated Driver:

    • Switching to com.mysql.cj.jdbc.Driver ensures compatibility with the latest MySQL features, leading to faster query execution and reduced latency.
  4. JDBC URL Parameters:

    • Adding parameters like ?useSSL=false&serverTimezone=UTC avoids warnings and stabilizes connections, enhancing reliability.
  5. Safe Resource Management:

    • Checking for null before closing dataSource prevents errors and resource leaks, maintaining application performance over time.

Overall Impact

These changes should result in:

Overall, expect a more stable and responsive plugin with better performance metrics!

ReferTV commented 1 month ago

You can test at your env that there was a momentary spike in MSPT earlier while receiving the reward