Skip to content

1.3

Choose a tag to compare

@Matteo842 Matteo842 released this 15 Jun 01:20
· 2 commits to master since this release

EasyFPS v1.3.0

This release introduces significant performance optimizations—headlined by a new responsive sliding-window FPS counter—native multi-monitor support, overhauled system resource management, and a robust CI/CD and testing suite.


🚀 Performance & Responsiveness

  • Sliding-Window FPS Computation (New): Replaced whole-buffer averaging with a short, configurable time window (FPS_WINDOW_MS = 500ms). The engine now walks backward through recent samples, accumulating frame times until the window is met. This makes the FPS counter drastically faster and highly responsive to real-time framerate fluctuations.
  • Near-Zero Idle CPU Usage: Replaced the sleep(2ms) busy-loop with MsgWaitForMultipleObjectsEx. When idle, CPU consumption drops close to 0% while still maintaining a smooth ~60Hz refresh rate.
  • Event-Driven Overlay Thread: Refactored the overlay thread to block natively on GetMessageW instead of continuously polling the system every 16ms.
  • GDI Font Caching: Fonts are now cached and only recreated when the overlay size changes, rather than being allocated and destroyed on every single WM_PAINT cycle. Enabled CLEARTYPE_QUALITY for much crisper text rendering.
  • Smart Redrawing: The overlay now updates and redraws only when the displayed values actually change, using a lightweight, comparable RenderSignature.
  • Optimized 1% Low Calculation: Upgraded the 1% low algorithmic logic to use select_nth_unstable_by, bringing the performance complexity down to $O(n)$ compared to a full buffer sort.
  • Smart Resource Releasing: PresentMon is now automatically stopped after ~2 seconds if no game is detected in the foreground, completely freeing up system resources.

🖥️ Multi-Monitor Support

  • Dynamic Monitor Positioning: Fullscreen detection and overlay positioning are now bound to the actual monitor where the active window resides (MonitorFromWindow + GetMonitorInfoW), removing the restriction that forced the overlay onto the primary display only.

🛡️ Robustness & Stability

  • Resilient FPS Capture: The reader thread no longer crashes upon encountering a single read error.
  • Cross-Version PresentMon Tolerance: Enhanced column parsing to be fully tolerant across different PresentMon versions (safely handles both MsBetweenPresents and msBetweenPresents).
  • Native Registry Management: Refactored the Windows startup registry handling to use native Win32 APIs (RegOpenKeyExW, RegSetValueExW, RegDeleteValueW) instead of spawning an external reg subprocess.
  • Opt-in Debug Logging: Switched to an opt-in logging system via the EASYFPS_DEBUG environment variable, preventing the old debug.log file from growing indefinitely.

🛠️ Code Quality, Testing & CI/CD

  • Expanded Test Suite: Added 14 unit tests covering core engine logic, including FPS window tracking, 1% low sample ordering/calculations, header parsing, fullscreen heuristics, settings serialization, colors, and dimensions.
  • Automated CI Workflow: Integrated a GitHub Actions workflow that automatically runs cargo fmt --check, clippy -D warnings, executes tests, and builds release binaries.
  • Codebase Cleanup: Fully translated all Italian code comments to English, resolved outstanding Clippy lints, and introduced clean type aliases for callback functions.
  • Documented Constants: Added comprehensive documentation for internal architecture constants including MAX_SAMPLES and FPS_WINDOW_MS.

⚠️ Note for Developers / Contributors

  • build.rs & Admin Privileges Fix: The Administrator manifest is now embedded only in release builds. This allows cargo test to execute test binaries locally without requiring elevated privileges, resolving the dreaded Windows Error 740.
  • If you need to force elevation during a debug build, you can use the new override flag: EASYFPS_FORCE_MANIFEST=1.
  • Testing Live Data: Because debug builds no longer request admin rights by default, you must run your IDE/terminal as Administrator or compile in --release if you want to test the overlay with live, real-time game capture data.

Contributors

@kRVRKV